]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Set SA_RESTART on non-lethal signals (REQ_INFO, FLUSH_PCAP) to avoid corrupting binar...
[tcpdump] / tcpdump.c
index e028d2e7ebdfa8fcd751efe1d23ddac5199d82d7..515edf5d47c2bf72470cb8b1f2af34bbbb32a19e 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -2743,7 +2743,14 @@ static void
 
        memset(&new, 0, sizeof(new));
        new.sa_handler = func;
-       if (sig == SIGCHLD)
+       if ((sig == SIGCHLD)
+# ifdef SIGNAL_REQ_INFO
+               || (sig == SIGNAL_REQ_INFO)
+# endif
+# ifdef SIGNAL_FLUSH_PCAP
+               || (sig == SIGNAL_FLUSH_PCAP)
+# endif
+               )
                new.sa_flags = SA_RESTART;
        if (sigaction(sig, &new, &old) < 0)
                return (SIG_ERR);