mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-27 04:32:15 +01:00
threads: don't do rlimit test when running as root
Linux CAP_SYS_RESOURCE overrides RLIMIT_NPROC so we probably shouldn't test thread creation failure when running the test as root...
This commit is contained in:
parent
9670d06a66
commit
ce0ff7c9da
@ -136,6 +136,12 @@ test_thread4 (void)
|
|||||||
GError *error;
|
GError *error;
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
|
/* Linux CAP_SYS_RESOURCE overrides RLIMIT_NPROC, and probably similar
|
||||||
|
* things are true on other systems.
|
||||||
|
*/
|
||||||
|
if (getuid () == 0 || geteuid () == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
getrlimit (RLIMIT_NPROC, &nl);
|
getrlimit (RLIMIT_NPROC, &nl);
|
||||||
nl.rlim_cur = 1;
|
nl.rlim_cur = 1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user