diff options
author | Jim Meyering <jim@meyering.net> | 2002-11-10 09:56:19 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-11-10 09:56:19 +0000 |
commit | a040c8e428d09ccb1f5f831ab4e2a7ff261abf6e (patch) | |
tree | 5700a16c84b42d6fbe853012c42fdcf0a8a5366a /src | |
parent | faf852d2dd35280290d92c231c368427a0cc318f (diff) | |
download | coreutils-a040c8e428d09ccb1f5f831ab4e2a7ff261abf6e.tar.xz |
(sighandler): Use raise, rather than kill+getpid.
(main): Declare `nsigs' to be unsigned, not int.
Diffstat (limited to 'src')
-rw-r--r-- | src/sort.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/sort.c b/src/sort.c index a8c0d8ed4..9ef109381 100644 --- a/src/sort.c +++ b/src/sort.c @@ -242,9 +242,6 @@ static size_t temp_dir_count; /* Number of allocated slots in temp_dirs. */ static size_t temp_dir_alloc; -/* Our process ID. */ -static pid_t process_id; - /* Flag to reverse the order of all comparisons. */ static int reverse; @@ -2096,7 +2093,7 @@ sighandler (int sig) signal (sig, SIG_DFL); #endif - kill (process_id, sig); + raise (sig); } /* Set the ordering options for KEY specified in S. @@ -2172,13 +2169,12 @@ main (int argc, char **argv) char *minus = "-", **files; char const *outfile = minus; static int const sigs[] = { SIGHUP, SIGINT, SIGPIPE, SIGTERM }; - int nsigs = sizeof sigs / sizeof *sigs; + unsigned nsigs = sizeof sigs / sizeof *sigs; #ifdef SA_NOCLDSTOP struct sigaction oldact, newact; #endif program_name = argv[0]; - process_id = getpid (); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); |