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:
parent
f446b24415
commit
71d8f36eb4
|
@ -0,0 +1,2 @@
|
|||
Fix faulthandler_suppress_crash_report() used to prevent core dump files
|
||||
when testing crashes. getrlimit() returns zero on success.
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue