about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-10-08 02:16:29 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2013-10-08 02:16:29 +0000
commit975c1ac73aabde3f19ff2fee1a659cab60879560 (patch)
tree3e8b33aa4c963e9096489af5ce4ed1e19b30b3d4 /lib
parentf794be7369ce393cd84c42035c89807fc49f9c9b (diff)
downloadnetpbm-mirror-975c1ac73aabde3f19ff2fee1a659cab60879560.tar.gz
netpbm-mirror-975c1ac73aabde3f19ff2fee1a659cab60879560.tar.xz
netpbm-mirror-975c1ac73aabde3f19ff2fee1a659cab60879560.zip
Restore recognition of SIGPWR if it's defined as a macro
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2011 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r--lib/libsystem.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/lib/libsystem.c b/lib/libsystem.c
index d6c69c2b..be21c686 100644
--- a/lib/libsystem.c
+++ b/lib/libsystem.c
@@ -220,6 +220,18 @@ spawnProcessor(const char *  const progName,
 static const char *
 signalName(unsigned int const signalClass) {
 
+/* There are various signal classes that are not universally defined,
+   so we make a half-hearted attempt to determine whether they are and
+   not try to recognize the ones that aren't.  We do this by testing
+   whether a macro is defind with the signal class name.  That could give
+   a false negative, because the signal class name isn't necessarily
+   defined as a macro, but it's a really, really small problem to miss
+   one of these signal classes here, so we don't bother with all the work
+   it would take to do it right.
+
+   OpenBSD does not have SIGWINCH and SIGIO in 2013.  Everyone else seems
+   to have it.
+*/
     switch (signalClass) {
     case SIGHUP: /* POSIX.1 */
         return "SIGHUP";
@@ -273,12 +285,6 @@ signalName(unsigned int const signalClass) {
         return "SIGVTALRM";
     case SIGPROF:
         return "SIGPROF";
-/* Most systems have SIGWINCH and SIGIO, but at least OpenBSD, in 2013,
-   does not.  Systems that do don't necessarily supply it as a macro, so
-   the following tests are not perfect, but a false negative is a really,
-   really, small problem, so we don't bother with all the work it would
-   take to do better.
-*/
 #ifdef SIGWINCH
     case SIGWINCH:
         return "SIGWINCH";
@@ -287,16 +293,14 @@ signalName(unsigned int const signalClass) {
     case SIGIO:
         return "SIGIO";
 #endif
+#ifdef HAVE_SIGPWR
+    case SIGPWR:
+        return "SIGPWR";
+#endif
     case SIGSYS:
         return "SIGSYS";
     default:
         return "???";
-
-        /* There are various other signal classes on some systems, but
-           not defined by POSIX and not on at least one system we
-           know of for which someone wanted to compile Netpbm.  The
-           list includes: SIGPWR, SIGLOST, SIGINFO, SIGRTxx.
-        */
     }
 }