mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-25 11:42:10 +01:00
tests: Remove some redundant writes
`ret` was never read. This fixes scan-build warnings: ``` ../../../../source/glib/glib/tests/thread.c:148:8: warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores] if ((ret = prlimit (getpid (), RLIMIT_NPROC, &nl, &ol)) != 0) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../../../source/glib/glib/tests/thread.c:174:8: warning: Although the value stored to 'ret' is used in the enclosing expression, the value is never actually read from 'ret' [deadcode.DeadStores] if ((ret = prlimit (getpid (), RLIMIT_NPROC, &ol, NULL)) != 0) ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1767
This commit is contained in:
parent
de5b30df84
commit
b509e59726
@ -140,12 +140,11 @@ test_thread4 (void)
|
||||
struct rlimit ol, nl;
|
||||
GThread *thread;
|
||||
GError *error;
|
||||
gint ret;
|
||||
|
||||
getrlimit (RLIMIT_NPROC, &nl);
|
||||
nl.rlim_cur = 1;
|
||||
|
||||
if ((ret = prlimit (getpid (), RLIMIT_NPROC, &nl, &ol)) != 0)
|
||||
if (prlimit (getpid (), RLIMIT_NPROC, &nl, &ol) != 0)
|
||||
g_error ("prlimit failed: %s", g_strerror (errno));
|
||||
|
||||
error = NULL;
|
||||
@ -171,7 +170,7 @@ test_thread4 (void)
|
||||
g_error_free (error);
|
||||
}
|
||||
|
||||
if ((ret = prlimit (getpid (), RLIMIT_NPROC, &ol, NULL)) != 0)
|
||||
if (prlimit (getpid (), RLIMIT_NPROC, &ol, NULL) != 0)
|
||||
g_error ("resetting RLIMIT_NPROC failed: %s", g_strerror (errno));
|
||||
#endif
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user