ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit 1ae9f4971084cdcab7561da21d70ff8f6198eb7e
parent d1f4d3521898f1204da517e2801fcdfdd13f59c6
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Mon, 11 Sep 2006 09:08:03 +0000

make impractical a race condition bug whereby double-frees can occur
by multiple (trapped) signals delivered to ngrep before exit().  set
all trapped signals to SIG_IGN immediately upon signal entry.  seems
to be happening more frequently in the last year.

Diffstat:
Mngrep.c | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/ngrep.c b/ngrep.c @@ -1246,6 +1246,14 @@ void version(void) { void clean_exit(int32_t sig) { struct pcap_stat s; + signal(SIGINT, SIG_IGN); + signal(SIGABRT, SIG_IGN); +#if !defined(_WIN32) + signal(SIGQUIT, SIG_IGN); + signal(SIGPIPE, SIG_IGN); + signal(SIGWINCH, SIG_IGN); +#endif + if (quiet < 1 && sig >= 0) printf("exit\n");