summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMichael Osipov <1983-01-06@gmx.net>2018-08-23 13:27:19 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2018-08-23 13:27:19 (GMT)
commit48ce4897f8f8d91d948ecd1241ffab002df2be9e (patch)
treec07a85ee488b78bf02db2716d2ca7619e370171b /Modules
parent89487f51b8d6ba8a55f5de0ed689e46fefe73cc9 (diff)
downloadcpython-48ce4897f8f8d91d948ecd1241ffab002df2be9e.zip
cpython-48ce4897f8f8d91d948ecd1241ffab002df2be9e.tar.gz
cpython-48ce4897f8f8d91d948ecd1241ffab002df2be9e.tar.bz2
bpo-34412: Make signal.strsignal() work on HP-UX (GH-8786)
Introduce a configure check for strsignal(3) which defines HAVE_STRSIGNAL for signalmodule.c. Add some common signals on HP-UX. This change applies for Windows and HP-UX.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/signalmodule.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 9de5c2e..d120948 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -530,9 +530,27 @@ signal_strsignal_impl(PyObject *module, int signalnum)
return NULL;
}
-#ifdef MS_WINDOWS
- /* Custom redefinition of POSIX signals allowed on Windows */
+#ifndef HAVE_STRSIGNAL
switch (signalnum) {
+ /* Though being a UNIX, HP-UX does not provide strsignal(3). */
+#ifndef MS_WINDOWS
+ case SIGHUP:
+ res = "Hangup";
+ break;
+ case SIGALRM:
+ res = "Alarm clock";
+ break;
+ case SIGPIPE:
+ res = "Broken pipe";
+ break;
+ case SIGQUIT:
+ res = "Quit";
+ break;
+ case SIGCHLD:
+ res = "Child exited";
+ break;
+#endif
+ /* Custom redefinition of POSIX signals allowed on Windows. */
case SIGINT:
res = "Interrupt";
break;