From 67247c7225ac8f4714fa0f258327a859459b3093 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 5 May 1996 08:20:25 +0000 Subject: [PATCH] report signal type before dying; from ian@cygnus.com forwarded by niklas --- gnu/usr.bin/cvs/src/main.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/gnu/usr.bin/cvs/src/main.c b/gnu/usr.bin/cvs/src/main.c index 0ebd78da575..2b232585210 100644 --- a/gnu/usr.bin/cvs/src/main.c +++ b/gnu/usr.bin/cvs/src/main.c @@ -220,9 +220,31 @@ static const char *const cmd_usage[] = }; static RETSIGTYPE -main_cleanup () +main_cleanup (sig) + int sig; { - exit (1); + const char *name; + + switch (sig) + { + case SIGHUP: + name = "hangup"; + break; + case SIGINT: + name = "interrupt"; + break; + case SIGQUIT: + name = "quit"; + break; + case SIGPIPE: + name = "broken pipe"; + break; + case SIGTERM: + name = "termination"; + break; + } + + error (1, 0, "received %s signal", name); } static void -- 2.20.1