From: Victor Stinner Date: Sun, 15 May 2011 08:21:59 +0000 (+0200) Subject: Issue #12060: Use sig_atomic_t type and volatile keyword in the signal module. X-Git-Tag: v3.1.4rc1~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ec6b176bd0fc41c6d00f244a4d8d6bdefa2c620;p=thirdparty%2FPython%2Fcpython.git Issue #12060: Use sig_atomic_t type and volatile keyword in the signal module. Patch written by Charles-François Natali. --- diff --git a/Misc/NEWS b/Misc/NEWS index 8618363e2ddb..c41e475cc94c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.1.4? Core and Builtins ----------------- +- Issue #12060: Use sig_atomic_t type and volatile keyword in the signal + module. Patch written by Charles-François Natali. + - Issue #1195: Fix input() if it is interrupted by CTRL+d and then CTRL+c, clear the end-of-file indicator after CTRL+d. diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index 14297709c51d..5a6c777fb542 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -78,12 +78,12 @@ static long main_thread; static pid_t main_pid; #endif -static struct { - int tripped; +static volatile struct { + sig_atomic_t tripped; PyObject *func; } Handlers[NSIG]; -static sig_atomic_t wakeup_fd = -1; +static volatile sig_atomic_t wakeup_fd = -1; /* Speed up sigcheck() when none tripped */ static volatile sig_atomic_t is_tripped = 0;