From 9e94e85e10757aedd7f8dfdbea2ecafcbbb658fd Mon Sep 17 00:00:00 2001 From: Arturo Borrero Gonzalez Date: Thu, 27 Oct 2016 12:20:17 +0200 Subject: sync-mode: print errno message on failure I have observed this message several times: [ERROR] can't open channel socket [ERROR] initialization failed which is very difficult to understand. The errno message should help this to be a bit more explicit. With this patch, in the case of wrong interface: [ERROR] can't open channel socket: No such device [ERROR] initialization failed Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Florian Westphal --- src/sync-mode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sync-mode.c b/src/sync-mode.c index e69ecfe..8fe65f1 100644 --- a/src/sync-mode.c +++ b/src/sync-mode.c @@ -412,7 +412,8 @@ static int init_sync(void) STATE_SYNC(channel) = multichannel_open(CONFIG(channel), CONFIG(channel_num)); if (STATE_SYNC(channel) == NULL) { - dlog(LOG_ERR, "can't open channel socket"); + dlog(LOG_ERR, "can't open channel socket: %s", + strerror(errno)); return -1; } for (i=0; ichannel_num; i++) { -- cgit v1.2.3