mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
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.
This commit is contained in:
parent
89487f51b8
commit
48ce4897f8
6 changed files with 27 additions and 4 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue