diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-12-17 13:50:07 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-12-17 13:50:16 -0500 |
commit | cc92cca43162c4635e6ab5e7c61f7f8728d56d9a (patch) | |
tree | 56fc978fa66945a4350e192a89b166f29f2c65c1 /src | |
parent | ca4103025dfe26eaaf6a500dec9170fbb176eebc (diff) | |
download | postgresql-cc92cca43162c4635e6ab5e7c61f7f8728d56d9a.tar.gz postgresql-cc92cca43162c4635e6ab5e7c61f7f8728d56d9a.zip |
Drop support for getting signal descriptions from sys_siglist[].
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
Diffstat (limited to 'src')
-rw-r--r-- | src/include/pg_config.h.in | 4 | ||||
-rw-r--r-- | src/port/pgstrsignal.c | 21 |
2 files changed, 9 insertions, 16 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 0a5ddd2e92c..76bd81e9bf2 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -192,10 +192,6 @@ 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 diff --git a/src/port/pgstrsignal.c b/src/port/pgstrsignal.c index ec989229baa..b0ca4956e5b 100644 --- a/src/port/pgstrsignal.c +++ b/src/port/pgstrsignal.c @@ -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 /* |