[Python-checkins] bpo-32252: Fix faulthandler_suppress_crash_report() (GH-4794) (#4795)
Victor Stinner
webhook-mailer at python.org
Mon Dec 11 08:17:10 EST 2017
https://github.com/python/cpython/commit/71d8f36eb450cdbc4b5397e25f6f3f5d676aca79
commit: 71d8f36eb450cdbc4b5397e25f6f3f5d676aca79
branch: 3.6
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Victor Stinner <victor.stinner at gmail.com>
date: 2017-12-11T14:17:06+01:00
summary:
bpo-32252: Fix faulthandler_suppress_crash_report() (GH-4794) (#4795)
Fix faulthandler_suppress_crash_report() used to prevent core dump files
when testing crashes. getrlimit() returns zero on success.
(cherry picked from commit 48d4dd974f0c8d47c54990eedd322b96b19c60ec)
files:
A Misc/NEWS.d/next/Tests/2017-12-11-13-31-33.bpo-32252.YnFw7J.rst
M Modules/faulthandler.c
diff --git a/Misc/NEWS.d/next/Tests/2017-12-11-13-31-33.bpo-32252.YnFw7J.rst b/Misc/NEWS.d/next/Tests/2017-12-11-13-31-33.bpo-32252.YnFw7J.rst
new file mode 100644
index 00000000000..ee4c56bb73f
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2017-12-11-13-31-33.bpo-32252.YnFw7J.rst
@@ -0,0 +1,2 @@
+Fix faulthandler_suppress_crash_report() used to prevent core dump files
+when testing crashes. getrlimit() returns zero on success.
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index d5194cad610..92aa1d444bb 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -936,7 +936,7 @@ faulthandler_suppress_crash_report(void)
struct rlimit rl;
/* Disable creation of core dump */
- if (getrlimit(RLIMIT_CORE, &rl) != 0) {
+ if (getrlimit(RLIMIT_CORE, &rl) == 0) {
rl.rlim_cur = 0;
setrlimit(RLIMIT_CORE, &rl);
}
More information about the Python-checkins
mailing list