]> granicus.if.org Git - python/commitdiff
bpo-32252: Fix faulthandler_suppress_crash_report() (GH-4794) (#4795)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 11 Dec 2017 13:17:06 +0000 (05:17 -0800)
committerVictor Stinner <victor.stinner@gmail.com>
Mon, 11 Dec 2017 13:17:06 +0000 (14:17 +0100)
Fix faulthandler_suppress_crash_report() used to prevent core dump files
when testing crashes. getrlimit() returns zero on success.
(cherry picked from commit 48d4dd974f0c8d47c54990eedd322b96b19c60ec)

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 d5194cad610080af26e990fe16205482affb3ca0..92aa1d444bb4fbed029090ccd087262df430dbf4 100644 (file)
@@ -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);
     }