]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
add an error message if more than one monitor
authorMichel Normand <normand@fr.ibm.com>
Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 28 May 2009 13:32:29 +0000 (15:32 +0200)
the change introduced by commit 31c53c2e1afc6c81ce4aad5ef4cb982cd2fea365
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: Michel Normand <normand@fr.ibm.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/monitor.c

index 24e85e7adcb391f7ead61ea4ad0b4757c92906db..17d0a8e5e400b5e8b3764ab0222b70236c4a1bf2 100644 (file)
@@ -142,10 +142,13 @@ int lxc_monitor_open(void)
        strcpy(offset, "lxc-monitor");
 
        fd = socket(PF_UNIX, SOCK_DGRAM, 0);
-       if (fd < 0)
+       if (fd < 0) {
+               ERROR("socket : %s", strerror(errno));
                return -1;
+       }
 
        if (bind(fd, (struct sockaddr *)&addr, sizeof(addr))) {
+               ERROR("bind : %s", strerror(errno));
                close(fd);
                return -1;
        }