From: <al...@us...> - 2002-09-26 18:09:38
|
Update of /cvsroot/msyslog/syslog/src/modules In directory usw-pr-cvs1:/tmp/cvs-serv22597/src/modules Modified Files: im_serial.c Log Message: properly comment out Index: im_serial.c =================================================================== RCS file: /cvsroot/msyslog/syslog/src/modules/im_serial.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- im_serial.c 30 Aug 2002 21:46:47 -0000 1.2 +++ im_serial.c 26 Sep 2002 18:09:35 -0000 1.3 @@ -173,14 +173,16 @@ int wchr; int nx; struct im_serial_ctx *c = (struct im_serial_ctx *) (im->im_ctx); +#ifdef IGNORE_PIPES RETSIGTYPE (*sigsave)(int); +#endif m_dprintf(MSYSLOG_INFORMATIVE, "im_serial_read: entering...\n"); - /* ignore sigserials */ - /* - sigsave = place_signal(SIGPIPE, SIG_IGN); - */ +#ifdef IGNORE_PIPES + /* ignore sigserials */ + sigsave = place_signal(SIGPIPE, SIG_IGN); +#endif /* read a complete message converting non printable characters into 'X' */ nx = read(im->im_fd, im->im_buf, sizeof(im->im_buf) - 1); @@ -188,7 +190,9 @@ if (nx < 0 && errno != EINTR) { m_dprintf(MSYSLOG_SERIOUS, "im_serial_read: error: [%d]\n", errno); logerror("im_serial_read"); +#ifdef IGNORE_PIPES place_signal(SIGPIPE, sigsave); +#endif return -1; } @@ -329,11 +333,12 @@ m_dprintf(MSYSLOG_INFORMATIVE, "im_serial_read: bytes remaining: [%d]\n", (endmark - nextline)); } } + +#ifdef IGNORE_PIPES /* restore previous SIGPIPE handler */ - /* place_signal(SIGPIPE, sigsave); - */ -return (0); +#endif + return (0); } /* |