diff options
author | 2015-10-14 04:55:17 +0000 | |
---|---|---|
committer | 2015-10-14 04:55:17 +0000 | |
commit | 9ae4abf6fca2a6417dfff8fd0fb8ac10a47c2a4c (patch) | |
tree | b475b2171c23bdb856297f742b79fa15d977e083 /usr.sbin/tcpdump/tcpdump.c | |
parent | pledge "tty" can allow ioctl TIOCEXCL on a tty (diff) | |
download | wireguard-openbsd-9ae4abf6fca2a6417dfff8fd0fb8ac10a47c2a4c.tar.xz wireguard-openbsd-9ae4abf6fca2a6417dfff8fd0fb8ac10a47c2a4c.zip |
Remove conditional compilation and #defines around signal handling
Don't catch signals that were ignored on entry
Suppress SIGCHLD if our kid is stopped: we don't care and it's not an error
ok millert@
Diffstat (limited to 'usr.sbin/tcpdump/tcpdump.c')
-rw-r--r-- | usr.sbin/tcpdump/tcpdump.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c index 98d729b1cd1..a0ed77cc7d6 100644 --- a/usr.sbin/tcpdump/tcpdump.c +++ b/usr.sbin/tcpdump/tcpdump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpdump.c,v 1.74 2015/10/09 01:37:09 deraadt Exp $ */ +/* $OpenBSD: tcpdump.c,v 1.75 2015/10/14 04:55:17 guenther Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 @@ -92,8 +92,8 @@ extern void bpf_dump(struct bpf_program *, int); extern int esp_init(char *); /* Forwards */ -RETSIGTYPE cleanup(int); -RETSIGTYPE gotchld(int); +void cleanup(int); +void gotchld(int); extern __dead void usage(void); /* Length of saved portion of packet. */ @@ -503,8 +503,7 @@ main(int argc, char **argv) } /* make a clean exit on interrupts */ -/* ARGSUSED */ -RETSIGTYPE +void cleanup(int signo) { struct pcap_stat stat; @@ -533,8 +532,7 @@ cleanup(int signo) _exit(0); } -/* ARGSUSED */ -RETSIGTYPE +void gotchld(int signo) { pid_t pid; @@ -681,14 +679,10 @@ default_print(register const u_char *bp, register u_int length) void set_slave_signals(void) { - RETSIGTYPE (*oldhandler)(int); - setsignal(SIGTERM, cleanup); setsignal(SIGINT, cleanup); setsignal(SIGCHLD, gotchld); - /* Cooperate with nohup(1) XXX is this still necessary/working? */ - if ((oldhandler = setsignal(SIGHUP, cleanup)) != SIG_DFL) - (void)setsignal(SIGHUP, oldhandler); + setsignal(SIGHUP, cleanup); } __dead void |