1 --- a/sysklogd/syslogd.c
2 +++ b/sysklogd/syslogd.c
3 @@ -555,6 +555,7 @@ static void do_syslogd(void)
6 #if ENABLE_FEATURE_REMOTE_LOG
10 #if ENABLE_FEATURE_SYSLOGD_DUP
11 @@ -636,11 +637,23 @@ static void do_syslogd(void)
12 if (rh->remoteFD == -1)
15 - /* Send message to remote logger, ignore possible error */
16 - /* TODO: on some errors, close and set G.remoteFD to -1
17 - * so that DNS resolution and connect is retried? */
18 - sendto(rh->remoteFD, recvbuf, sz+1, MSG_DONTWAIT,
19 - &(rh->remoteAddr->u.sa), rh->remoteAddr->len);
20 + /* Send message to remote logger */
21 + if (sendto(rh->remoteFD, recvbuf, sz+1, MSG_DONTWAIT,
22 + &(rh->remoteAddr->u.sa), rh->remoteAddr->len) == -1)
25 + /* On some errors, close and set G.remoteFD to -1
26 + * so that DNS resolution and connect is retried */
33 + close(rh->remoteFD);
39 if (!ENABLE_FEATURE_REMOTE_LOG || (option_mask32 & OPT_locallog)) {