--- ./sysklogd/syslogd.c.klogd4 2006-03-13 17:11:41.000000000 +0100 +++ ./sysklogd/syslogd.c 2006-03-13 18:12:20.000000000 +0100 @@ -600,10 +600,14 @@ _PATH_LOG); } - if (fcntl(sock_fd, F_SETFL, O_NONBLOCK) < 0) { + if (fcntl(sock_fd, F_SETFL, O_RDWR | O_NONBLOCK) < 0) { bb_perror_msg_and_die("Couldn't mark UNIX socket " _PATH_LOG " non-blocking"); } + if (fcntl(sock_fd, F_SETFD, FD_CLOEXEC) < 0) { + bb_perror_msg_and_die("Couldn't mark UNIX socket " _PATH_LOG " close-on-exec"); + } + addrLength = sizeof(sunx.sun_family) + strlen(sunx.sun_path); if (bind(sock_fd, (struct sockaddr *) &sunx, addrLength) < 0) { bb_perror_msg_and_die("Could not connect to socket " _PATH_LOG);