summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1995-02-22 03:13:12 +0000
committerRoland McGrath <roland@redhat.com>1995-02-22 03:13:12 +0000
commit5c350f4fd5e42153d5df125dc4687216bf7b09aa (patch)
tree8e9a41ecc216a8bad4a853a4e8da90292f88b3cc
parent514c4bac336fa726ac1955c92b4e071cf21b4fc8 (diff)
downloadgunmake-5c350f4fd5e42153d5df125dc4687216bf7b09aa.tar.gz
[! HAVE_STRSIGNAL] (strsignal): New function.
-rw-r--r--signame.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/signame.c b/signame.c
index 5f8deab..40e72e0 100644
--- a/signame.c
+++ b/signame.c
@@ -1,5 +1,5 @@
/* Convert between signal names and numbers.
- Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc.
+ Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -273,3 +273,20 @@ psignal (signal, message)
fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
}
#endif
+
+#ifndef HAVE_STRSIGNAL
+/* Return the string associated with the signal number. */
+
+char *
+strsignal (signal)
+ int signal;
+{
+ static char buf[] = "Signal 12345678901234567890";
+
+ if (signal > 0 || signal < NSIG)
+ return sys_siglist[signal];
+
+ sprintf (buf, "Signal %d", signal);
+ return buf;
+}
+#endif