1
0
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:
Osama Abdelkader
2025-10-28 23:58:35 +03:00
committed by Collin Funk
parent 096fcdc0a5
commit 96073e9f34
5 changed files with 5 additions and 5 deletions

View File

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