]> granicus.if.org Git - postgresql/commitdiff
Drop support for getting signal descriptions from sys_siglist[].
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Dec 2018 18:50:07 +0000 (13:50 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 17 Dec 2018 18:50:16 +0000 (13:50 -0500)
It appears that all platforms that have sys_siglist[] also have
strsignal(), making that fallback case in pg_strsignal() dead code.
Getting rid of it allows dropping a configure test, which seems worth
more than providing textual signal descriptions on whatever platforms
might still hypothetically have use for the fallback case.

Discussion: https://postgr.es/m/25758.1544983503@sss.pgh.pa.us

configure
configure.in
src/include/pg_config.h.in
src/port/pgstrsignal.c

index 3dddd8d0ed5f9f20235c104e90da15ddb3bedf16..ea40f5f03dfc886a0d404a89b38810d298b05dad 100755 (executable)
--- a/configure
+++ b/configure
@@ -16064,24 +16064,6 @@ esac
 
 fi
 
-ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
-/* NetBSD declares sys_siglist in unistd.h.  */
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-"
-if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SYS_SIGLIST $ac_have_decl
-_ACEOF
-
-
 ac_fn_c_check_func "$LINENO" "syslog" "ac_cv_func_syslog"
 if test "x$ac_cv_func_syslog" = xyes; then :
   ac_fn_c_check_header_mongrel "$LINENO" "syslog.h" "ac_cv_header_syslog_h" "$ac_includes_default"
index 4fd6b8fc80c585a2d330cb012aae06fd52439994..89a0fb2470ff9f86c6c48d66bfc881d0e41f657d 100644 (file)
@@ -1787,14 +1787,6 @@ if test "$PORTNAME" = "cygwin"; then
   AC_LIBOBJ(dirmod)
 fi
 
-AC_CHECK_DECLS([sys_siglist], [], [],
-[#include <signal.h>
-/* NetBSD declares sys_siglist in unistd.h.  */
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-])
-
 AC_CHECK_FUNC(syslog,
               [AC_CHECK_HEADER(syslog.h,
                                [AC_DEFINE(HAVE_SYSLOG, 1, [Define to 1 if you have the syslog interface.])])])
index 0a5ddd2e92c82f0e7f6c77c79f5266ee2ea2f5c0..76bd81e9bf23bd64592a32e6f9f5adceecf52dab 100644 (file)
    don't. */
 #undef HAVE_DECL_STRTOULL
 
-/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SYS_SIGLIST
-
 /* Define to 1 if you have the `dlopen' function. */
 #undef HAVE_DLOPEN
 
index ec989229baaa151acab3a7ef076384bc5c8039e5..b0ca4956e5b81d8cd6999ca17a550f1fc4d413a7 100644 (file)
@@ -31,7 +31,7 @@
  * the string will remain valid across later calls to strsignal().
  *
  * This version guarantees to return a non-NULL pointer, although
- * some platforms' versions of strsignal() do not.
+ * some platforms' versions of strsignal() reputedly do not.
  */
 const char *
 pg_strsignal(int signum)
@@ -40,21 +40,18 @@ pg_strsignal(int signum)
 
        /*
         * If we have strsignal(3), use that --- but check its result for NULL.
-        * Otherwise, if we have sys_siglist[], use that; just out of paranoia,
-        * check for NULL there too.  (We assume there is no point in trying both
-        * APIs.)
         */
-#if defined(HAVE_STRSIGNAL)
+#ifdef HAVE_STRSIGNAL
        result = strsignal(signum);
        if (result)
                return result;
-#elif defined(HAVE_DECL_SYS_SIGLIST) && HAVE_DECL_SYS_SIGLIST
-       if (signum > 0 && signum < NSIG)
-       {
-               result = sys_siglist[signum];
-               if (result)
-                       return result;
-       }
+#else
+
+       /*
+        * We used to have code here to try to use sys_siglist[] if available.
+        * However, it seems that all platforms with sys_siglist[] have also had
+        * strsignal() for many years now, so that was just a waste of code.
+        */
 #endif
 
        /*