Commit 2c396e12 by Michel Normand Committed by Daniel Lezcano

add an error message if more than one monitor

the change introduced by commit 31c53c2e do not allow anymore to have more than one monitor. The purpose of this patch is to add an error message when such a condition is identified, eg: === lxc-monitor: bind : Address already in use === Signed-off-by: 's avatarMichel Normand <normand@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 018ef520
...@@ -142,10 +142,13 @@ int lxc_monitor_open(void) ...@@ -142,10 +142,13 @@ int lxc_monitor_open(void)
strcpy(offset, "lxc-monitor"); strcpy(offset, "lxc-monitor");
fd = socket(PF_UNIX, SOCK_DGRAM, 0); fd = socket(PF_UNIX, SOCK_DGRAM, 0);
if (fd < 0) if (fd < 0) {
ERROR("socket : %s", strerror(errno));
return -1; return -1;
}
if (bind(fd, (struct sockaddr *)&addr, sizeof(addr))) { if (bind(fd, (struct sockaddr *)&addr, sizeof(addr))) {
ERROR("bind : %s", strerror(errno));
close(fd); close(fd);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment