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.
This commit is contained in:
Victor Stinner 2017-12-11 13:57:12 +01:00 committed by GitHub
parent 19d0d54809
commit 48d4dd974f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1,2 @@
Fix faulthandler_suppress_crash_report() used to prevent core dump files
when testing crashes. getrlimit() returns zero on success.

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