Browse Source

bpo-32252: Fix faulthandler_suppress_crash_report() (#4794)

Fix faulthandler_suppress_crash_report() used to prevent core dump files
when testing crashes. getrlimit() returns zero on success.
pull/4788/merge
Victor Stinner 9 years ago
committed by GitHub
parent
commit
48d4dd974f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      Misc/NEWS.d/next/Tests/2017-12-11-13-31-33.bpo-32252.YnFw7J.rst
  2. 2
      Modules/faulthandler.c

2
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.

2
Modules/faulthandler.c

@ -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);
}

Loading…
Cancel
Save