From: Ben Gras Date: Tue, 4 Apr 2006 14:22:40 +0000 (+0000) Subject: Fix X-Git-Tag: v3.1.2a~53 X-Git-Url: http://zhaoyanbai.com/repos/%22/xml/v3/mem/static/processing.js?a=commitdiff_plain;h=7cfb7d912fd7ad98ee0655d448182f4f859f2962;p=minix.git Fix --- diff --git a/commands/syslogd/syslogd.c b/commands/syslogd/syslogd.c index 03108d17d..7f4e1411b 100644 --- a/commands/syslogd/syslogd.c +++ b/commands/syslogd/syslogd.c @@ -67,6 +67,9 @@ ** Extensive rewriting by G. Falzoni for porting to Minix ** ** $Log$ +** Revision 1.3 2006/04/04 14:22:40 beng +** Fix +** ** Revision 1.2 2006/04/04 14:18:16 beng ** Make syslogd work, even if it can only open klog and not udp or vice versa ** (but not neither) @@ -848,7 +851,8 @@ int main(int argc, char **argv) port == 0 ? sp->s_port : htons(port); udpopt.nwuo_remaddr = udpopt.nwuo_locaddr = htonl(0x7F000001L); - while (nfd >= 0 && ioctl(nfd, NWIOSUDPOPT, &udpopt) < 0 || + if(nfd >= 0) { + while (ioctl(nfd, NWIOSUDPOPT, &udpopt) < 0 || ioctl(nfd, NWIOGUDPOPT, &udpopt) < 0) { if (errno == EAGAIN) { sleep(1); @@ -857,6 +861,7 @@ int main(int argc, char **argv) logerror("Set/Get UDP options failed"); return EXIT_FAILURE; } + } /* Open kernel log device */ kfd = open("/dev/klog", O_NONBLOCK | O_RDONLY);