[PATCH 2/2] app/pdump: handle SIGTERM and SIGHUP
Stephen Hemminger
stephen at networkplumber.org
Tue Feb 27 19:09:49 CET 2024
On Tue, 27 Feb 2024 09:59:37 +0000
"Pattan, Reshma" <reshma.pattan at intel.com> wrote:
> > -----Original Message-----
> > From: Stephen Hemminger <stephen at networkplumber.org>
> > + sigaction(SIGHUP, NULL, &origaction);
>
> Why do we need this ? Can't be this direct sigaction(SIGHUP, &action, NULL) without a below if code?
> Can you please explain how this works.
>
> > + if (origaction.sa_handler == SIG_DFL)
> > + sigaction(SIGHUP, &action, NULL);
> >
>
If sighup is being ignored already (for example being run by nohup)
then the program should keep ignoring SIGHUP.
This is the method used in tshark and dumpcap utilities in wireshark
and it made sense.
More information about the dev
mailing list