report signal type before dying; from ian@cygnus.com forwarded by niklas
authorderaadt <deraadt@openbsd.org>
Sun, 5 May 1996 08:20:25 +0000 (08:20 +0000)
committerderaadt <deraadt@openbsd.org>
Sun, 5 May 1996 08:20:25 +0000 (08:20 +0000)
gnu/usr.bin/cvs/src/main.c

index 0ebd78d..2b23258 100644 (file)
@@ -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