mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
Issue #8407: The signal handler writes the signal number as a single byte
instead of a nul byte into the wakeup file descriptor. So it is possible to wait more than one signal and know which signals were raised.
This commit is contained in:
parent
b3e7219abf
commit
d49b1f14de
5 changed files with 35 additions and 5 deletions
|
@ -176,6 +176,7 @@ checksignals_witharg(void * unused)
|
|||
static void
|
||||
trip_signal(int sig_num)
|
||||
{
|
||||
unsigned char byte;
|
||||
Handlers[sig_num].tripped = 1;
|
||||
if (is_tripped)
|
||||
return;
|
||||
|
@ -183,8 +184,10 @@ trip_signal(int sig_num)
|
|||
cleared in PyErr_CheckSignals() before .tripped. */
|
||||
is_tripped = 1;
|
||||
Py_AddPendingCall(checksignals_witharg, NULL);
|
||||
if (wakeup_fd != -1)
|
||||
write(wakeup_fd, "\0", 1);
|
||||
if (wakeup_fd != -1) {
|
||||
byte = (unsigned char)sig_num;
|
||||
write(wakeup_fd, &byte, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue