diff options
-rw-r--r-- | lib/ChangeLog | 4 | ||||
-rw-r--r-- | lib/sigevent.c | 15 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 4c8e3786..22f60c24 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2004-12-15 Andrew J. Schorr <ajschorr@alumni.princeton.edu> + + * sigevent.c: (trap_default_signals) Ignore SIGPIPE instead of exiting. + 2004-12-10 Andrew J. Schorr <ajschorr@alumni.princeton.edu> * log.c: (zlog_signal,_zlog_assert_failed) Change logging level back to diff --git a/lib/sigevent.c b/lib/sigevent.c index 53503a7a..5ac226a4 100644 --- a/lib/sigevent.c +++ b/lib/sigevent.c @@ -191,7 +191,6 @@ trap_default_signals(void) static const int exit_signals[] = { SIGHUP, SIGINT, - SIGPIPE, SIGALRM, SIGTERM, SIGUSR1, @@ -206,19 +205,23 @@ trap_default_signals(void) SIGSTKFLT, #endif }; + static const int ignore_signals[] = { + SIGPIPE, + }; static const struct { const int *sigs; - int nsigs; + u_int nsigs; void (*handler)(int); - } sigmap[2] = { + } sigmap[] = { { core_signals, sizeof(core_signals)/sizeof(core_signals[0]),core_handler }, { exit_signals, sizeof(exit_signals)/sizeof(exit_signals[0]),exit_handler }, + { ignore_signals, sizeof(ignore_signals)/sizeof(ignore_signals[0]),SIG_IGN}, }; - int i; + u_int i; - for (i = 0; i < 2; i++) + for (i = 0; i < sizeof(sigmap)/sizeof(sigmap[0]); i++) { - int j; + u_int j; for (j = 0; j < sigmap[i].nsigs; j++) { |