mirror of
https://sourceware.org/git/glibc.git
synced 2025-11-06 19:29:35 +03:00
Fix incorrect setrlimit return value checks in tests
The setrlimit(2) function returns 0 on success and -1 on error, but several test files were incorrectly checking for a return value of 1 to detect errors. This means the error checks would never trigger, causing tests to continue silently even when setrlimit() failed. This commit fixes the error checks in five files to correctly test for -1, matching both the documented behavior and the pattern used correctly in other parts of the codebase. Signed-off-by: Osama Abdelkader <osama.abdelkader@gmail.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
This commit is contained in:
committed by
Collin Funk
parent
096fcdc0a5
commit
96073e9f34
@@ -33,7 +33,7 @@ increase_nofile (void)
|
||||
|
||||
rl.rlim_cur += 128;
|
||||
|
||||
if (setrlimit (RLIMIT_NOFILE, &rl) == 1)
|
||||
if (setrlimit (RLIMIT_NOFILE, &rl) == -1)
|
||||
FAIL_EXIT1 ("setrlimit (RLIMIT_NOFILE): %m");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user