Applied adjusted patch by Miquel van Smoorenburg to fix spurious

hanging syslogd in connection with futex and NPTL introduced in recent
glibc versions and Linux 2.6 (details: http://bugs.debian.org/301511)
This commit is contained in:
Joey Schulze 2005-05-25 18:08:30 +00:00
parent c9deb8536c
commit facf7ff5bb

View File

@ -1586,11 +1586,25 @@ void logmsg(pri, msg, from, flags)
int fac, prilev, lognum; int fac, prilev, lognum;
int msglen; int msglen;
char *timestamp; char *timestamp;
#ifdef __gnu_linux__
sigset_t mask;
#else
#ifndef SYSV
sigset_t omask;
#endif
#endif
dprintf("logmsg: %s, flags %x, from %s, msg %s\n", textpri(pri), flags, from, msg); dprintf("logmsg: %s, flags %x, from %s, msg %s\n", textpri(pri), flags, from, msg);
#ifdef __gnu_linux__
sigemptyset(&mask);
sigaddset(&mask, SIGHUP);
sigaddset(&mask, SIGALRM);
sigprocmask(SIG_BLOCK, &mask, NULL);
#else
#ifndef SYSV #ifndef SYSV
omask = sigblock(sigmask(SIGHUP)|sigmask(SIGALRM)); omask = sigblock(sigmask(SIGHUP)|sigmask(SIGALRM));
#endif
#endif #endif
/* /*
@ -1632,8 +1646,12 @@ void logmsg(pri, msg, from, flags)
(void) close(f->f_file); (void) close(f->f_file);
f->f_file = -1; f->f_file = -1;
} }
#ifdef __gnu_linux__
sigprocmask(SIG_UNBLOCK, &mask, NULL);
#else
#ifndef SYSV #ifndef SYSV
(void) sigsetmask(omask); (void) sigsetmask(omask);
#endif
#endif #endif
return; return;
} }
@ -1697,9 +1715,13 @@ void logmsg(pri, msg, from, flags)
} }
} }
} }
#ifdef __gnu_linux__
sigprocmask(SIG_UNBLOCK, &mask, NULL);
#else
#ifndef SYSV #ifndef SYSV
(void) sigsetmask(omask); (void) sigsetmask(omask);
#endif #endif
#endif
} }
#if FALSE #if FALSE
} /* balance parentheses for emacs */ } /* balance parentheses for emacs */