From 2c396e124b92f4d24fffaf86de3ceb74c5c76afe Mon Sep 17 00:00:00 2001 From: Michel Normand Date: Thu, 28 May 2009 15:32:29 +0200 Subject: [PATCH] add an error message if more than one monitor 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 Signed-off-by: Daniel Lezcano --- src/lxc/monitor.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lxc/monitor.c b/src/lxc/monitor.c index 24e85e7ad..17d0a8e5e 100644 --- a/src/lxc/monitor.c +++ b/src/lxc/monitor.c @@ -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; } -- 2.47.3