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 48d4dd974f)
This commit is contained in:
Miss Islington (bot) 2017-12-11 05:17:06 -08:00 committed by Victor Stinner
parent f446b24415
commit 71d8f36eb4
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

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