Enforce non-blocking sendto(). The kernel sources show that there should be no reason for blocking here but some users occasionally observe a blocked process when sending to unreachable remote servers. --- ./sysklogd/syslogd-flx24.c 2015-12-31 10:12:02.519648834 +0100 +++ ./sysklogd/syslogd.c 2015-12-31 10:24:27.923847008 +0100 @@ -425,6 +425,10 @@ bb_error_msg("cannot create socket"); } + if (fcntl(remotefd, F_SETFL, O_NONBLOCK) < 0) { + bb_perror_msg_and_die("Couldn't make UDP remote socket non-blocking"); + } + remoteaddr.sin_family = AF_INET; remoteaddr.sin_addr = *(struct in_addr *) *(xgethostbyname(RemoteHost))->h_addr_list; remoteaddr.sin_port = htons(RemotePort); @@ -501,7 +505,7 @@ /* send message to remote logger */ while ((now-- > 0) && ( -1 == sendto(remotefd, line, strlen(line), - MSG_NOSIGNAL, + MSG_NOSIGNAL | MSG_DONTWAIT, (struct sockaddr *) &remoteaddr, sizeof(remoteaddr))) && (errno == EINTR));