Skip to content

Commit 71d8f36

Browse files
miss-islingtonvstinner
authored andcommitted
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 48d4dd9)
1 parent f446b24 commit 71d8f36

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix faulthandler_suppress_crash_report() used to prevent core dump files
2+
when testing crashes. getrlimit() returns zero on success.

Modules/faulthandler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ faulthandler_suppress_crash_report(void)
936936
struct rlimit rl;
937937

938938
/* Disable creation of core dump */
939-
if (getrlimit(RLIMIT_CORE, &rl) != 0) {
939+
if (getrlimit(RLIMIT_CORE, &rl) == 0) {
940940
rl.rlim_cur = 0;
941941
setrlimit(RLIMIT_CORE, &rl);
942942
}

0 commit comments

Comments
 (0)