From 08e7a9d596493babc6a43f55b4ab62f909168d7c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 31 Dec 2015 12:28:34 +0100 Subject: syslogd: properly report error and die on socket error The use of bb_error_msg() instead of bb_perror_msg_and_die() hides the real cause of the socket error. Fix this. --- sysklogd/syslogd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 5652b20..7b400d1 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -423,7 +423,7 @@ static void init_RemoteLog(void) remotefd = socket(AF_INET, SOCK_DGRAM, 0); if (remotefd < 0) { - bb_error_msg("cannot create socket"); + bb_perror_msg_and_die("cannot create socket"); } if (fcntl(remotefd, F_SETFL, O_NONBLOCK) < 0) { @@ -443,7 +443,7 @@ static void init_LocalLog(void) listen_udp_fd = socket(AF_INET, SOCK_DGRAM, 0); if (listen_udp_fd < 0) { - bb_error_msg("cannot create socket"); + bb_perror_msg_and_die("cannot create socket"); } if (fcntl(listen_udp_fd, F_SETFL, O_NONBLOCK) < 0) { -- 1.7.12.1