Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ded666ff
Commit
ded666ff
authored
Jun 03, 2018
by
Antoine Pitrou
Committed by
GitHub
Jun 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.7] bpo-30654: Do not reset SIGINT handler to SIG_DFL in finisignal (GH-7146) (GH-7347)
(cherry picked from commit
e905c844
)
parent
9b5c9488
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
Misc/NEWS.d/next/Core and Builtins/2018-05-28-12-28-53.bpo-30654.9fDJye.rst
...ore and Builtins/2018-05-28-12-28-53.bpo-30654.9fDJye.rst
+2
-0
Modules/signalmodule.c
Modules/signalmodule.c
+2
-12
No files found.
Misc/NEWS.d/next/Core and Builtins/2018-05-28-12-28-53.bpo-30654.9fDJye.rst
0 → 100644
View file @
ded666ff
Fixed reset of the SIGINT handler to SIG_DFL on interpreter shutdown even
when there was a custom handler set previously. Patch by Philipp Kerling.
Modules/signalmodule.c
View file @
ded666ff
...
@@ -95,13 +95,6 @@ static PyObject *DefaultHandler;
...
@@ -95,13 +95,6 @@ static PyObject *DefaultHandler;
static
PyObject
*
IgnoreHandler
;
static
PyObject
*
IgnoreHandler
;
static
PyObject
*
IntHandler
;
static
PyObject
*
IntHandler
;
/* On Solaris 8, gcc will produce a warning that the function
declaration is not a prototype. This is caused by the definition of
SIG_DFL as (void (*)())0; the correct declaration would have been
(void (*)(int))0. */
static
PyOS_sighandler_t
old_siginthandler
=
SIG_DFL
;
#ifdef HAVE_GETITIMER
#ifdef HAVE_GETITIMER
static
PyObject
*
ItimerError
;
static
PyObject
*
ItimerError
;
...
@@ -629,7 +622,7 @@ initsignal(void)
...
@@ -629,7 +622,7 @@ initsignal(void)
/* Install default int handler */
/* Install default int handler */
Py_INCREF
(
IntHandler
);
Py_INCREF
(
IntHandler
);
Py_SETREF
(
Handlers
[
SIGINT
].
func
,
IntHandler
);
Py_SETREF
(
Handlers
[
SIGINT
].
func
,
IntHandler
);
old_siginthandler
=
PyOS_setsig
(
SIGINT
,
signal_handler
);
PyOS_setsig
(
SIGINT
,
signal_handler
);
}
}
#ifdef SIGHUP
#ifdef SIGHUP
...
@@ -872,14 +865,11 @@ finisignal(void)
...
@@ -872,14 +865,11 @@ finisignal(void)
int
i
;
int
i
;
PyObject
*
func
;
PyObject
*
func
;
PyOS_setsig
(
SIGINT
,
old_siginthandler
);
old_siginthandler
=
SIG_DFL
;
for
(
i
=
1
;
i
<
NSIG
;
i
++
)
{
for
(
i
=
1
;
i
<
NSIG
;
i
++
)
{
func
=
Handlers
[
i
].
func
;
func
=
Handlers
[
i
].
func
;
Handlers
[
i
].
tripped
=
0
;
Handlers
[
i
].
tripped
=
0
;
Handlers
[
i
].
func
=
NULL
;
Handlers
[
i
].
func
=
NULL
;
if
(
i
!=
SIGINT
&&
func
!=
NULL
&&
func
!=
Py_None
&&
if
(
func
!=
NULL
&&
func
!=
Py_None
&&
func
!=
DefaultHandler
&&
func
!=
IgnoreHandler
)
func
!=
DefaultHandler
&&
func
!=
IgnoreHandler
)
PyOS_setsig
(
i
,
SIG_DFL
);
PyOS_setsig
(
i
,
SIG_DFL
);
Py_XDECREF
(
func
);
Py_XDECREF
(
func
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment