mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #8407: Fix the signal handler of the signal module: if it is called
twice, it now writes the number of the second signal into the wakeup fd.
This commit is contained in:
parent
b45c7087aa
commit
c13ef66649
2 changed files with 37 additions and 8 deletions
|
|
@ -177,17 +177,18 @@ static void
|
|||
trip_signal(int sig_num)
|
||||
{
|
||||
unsigned char byte;
|
||||
|
||||
Handlers[sig_num].tripped = 1;
|
||||
if (wakeup_fd != -1) {
|
||||
byte = (unsigned char)sig_num;
|
||||
write(wakeup_fd, &byte, 1);
|
||||
}
|
||||
if (is_tripped)
|
||||
return;
|
||||
/* Set is_tripped after setting .tripped, as it gets
|
||||
cleared in PyErr_CheckSignals() before .tripped. */
|
||||
is_tripped = 1;
|
||||
Py_AddPendingCall(checksignals_witharg, NULL);
|
||||
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