From bdbd5d31f810a33f4922d63b1852ab96a5fc4a01 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 20 Jan 2007 09:54:20 +0100 Subject: Standardize on list of signals when an app catches signals. * src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL, SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ. * src/ls.c (main): Likewise (except SIGPIPE was already caught). Note that ls.c is special, as it also catches SIGTSTP. * src/sort.c (main): Likewise. Also catch SIGQUIT. More details in . --- src/csplit.c | 21 ++++++++++++++++++++- src/ls.c | 25 +++++++++++++++++++++++-- src/sort.c | 21 ++++++++++++++++++++- 3 files changed, 63 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/csplit.c b/src/csplit.c index 382fd6621..a26c80df3 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -1402,7 +1402,26 @@ main (int argc, char **argv) { int i; - static int const sig[] = { SIGHUP, SIGINT, SIGQUIT, SIGTERM }; + static int const sig[] = + { + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, +#ifdef SIGPOLL + SIGPOLL, +#endif +#ifdef SIGPROF + SIGPROF, +#endif +#ifdef SIGVTALRM + SIGVTALRM, +#endif +#ifdef SIGXCPU + SIGXCPU, +#endif +#ifdef SIGXFSZ + SIGXFSZ, +#endif + }; enum { nsigs = sizeof sig / sizeof sig[0] }; #if SA_NOCLDSTOP diff --git a/src/ls.c b/src/ls.c index feba59141..3864ed00c 100644 --- a/src/ls.c +++ b/src/ls.c @@ -1113,8 +1113,29 @@ main (int argc, char **argv) int n_files; /* The signals that are trapped, and the number of such signals. */ - static int const sig[] = { SIGHUP, SIGINT, SIGPIPE, - SIGQUIT, SIGTERM, SIGTSTP }; + static int const sig[] = + { + /* This one is handled specially. */ + SIGTSTP, + + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, +#ifdef SIGPOLL + SIGPOLL, +#endif +#ifdef SIGPROF + SIGPROF, +#endif +#ifdef SIGVTALRM + SIGVTALRM, +#endif +#ifdef SIGXCPU + SIGXCPU, +#endif +#ifdef SIGXFSZ + SIGXFSZ, +#endif + }; enum { nsigs = sizeof sig / sizeof sig[0] }; #if ! SA_NOCLDSTOP diff --git a/src/sort.c b/src/sort.c index 326866f29..8a2279637 100644 --- a/src/sort.c +++ b/src/sort.c @@ -2350,7 +2350,26 @@ main (int argc, char **argv) { size_t i; - static int const sig[] = { SIGHUP, SIGINT, SIGPIPE, SIGTERM }; + static int const sig[] = + { + /* The usual suspects. */ + SIGALRM, SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, +#ifdef SIGPOLL + SIGPOLL, +#endif +#ifdef SIGPROF + SIGPROF, +#endif +#ifdef SIGVTALRM + SIGVTALRM, +#endif +#ifdef SIGXCPU + SIGXCPU, +#endif +#ifdef SIGXFSZ + SIGXFSZ, +#endif + }; enum { nsigs = sizeof sig / sizeof sig[0] }; #if SA_NOCLDSTOP -- cgit v1.2.3-54-g00ecf