]> granicus.if.org Git - python/commitdiff
bpo-32252: Fix faulthandler_suppress_crash_report() (#4794)
authorVictor Stinner <victor.stinner@gmail.com>
Mon, 11 Dec 2017 12:57:12 +0000 (13:57 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2017 12:57:12 +0000 (13:57 +0100)
Fix faulthandler_suppress_crash_report() used to prevent core dump files
when testing crashes. getrlimit() returns zero on success.

Misc/NEWS.d/next/Tests/2017-12-11-13-31-33.bpo-32252.YnFw7J.rst [new file with mode: 0644]
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 (file)
index 0000000..ee4c56b
--- /dev/null
@@ -0,0 +1,2 @@
+Fix faulthandler_suppress_crash_report() used to prevent core dump files
+when testing crashes. getrlimit() returns zero on success.
index 0e85cce132f5e19acf1eea3fa29c00a24b6ca65e..baa2e917706a0351e021dc9989ff17b92b296ebc 100644 (file)
@@ -932,7 +932,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);
     }