summaryrefslogtreecommitdiffstats
path: root/Modules/signalmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 00:35:58 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-05-25 00:35:58 (GMT)
commitc13ef66649985025382c64f6af8e3b956411e05b (patch)
tree4f224212ec11dfefa32f093c777b09e1fe0e2ae7 /Modules/signalmodule.c
parentb45c7087aa967843f2e11116fbb4a7f5a32a1c3f (diff)
downloadcpython-c13ef66649985025382c64f6af8e3b956411e05b.zip
cpython-c13ef66649985025382c64f6af8e3b956411e05b.tar.gz
cpython-c13ef66649985025382c64f6af8e3b956411e05b.tar.bz2
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.
Diffstat (limited to 'Modules/signalmodule.c')
-rw-r--r--Modules/signalmodule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index ff65f04..6d27ab3 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -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