mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
Merge branch '1044-prlimit-fix' into 'master'
Fix prlimit() error handling in tests Closes #1044 See merge request GNOME/glib!164
This commit is contained in:
commit
a5d9fd2900
@ -21,6 +21,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -146,8 +147,8 @@ test_thread4 (void)
|
|||||||
getrlimit (RLIMIT_NPROC, &nl);
|
getrlimit (RLIMIT_NPROC, &nl);
|
||||||
nl.rlim_cur = 1;
|
nl.rlim_cur = 1;
|
||||||
|
|
||||||
if ((ret = prlimit (getpid(), RLIMIT_NPROC, &nl, &ol)) != 0)
|
if ((ret = prlimit (getpid (), RLIMIT_NPROC, &nl, &ol)) != 0)
|
||||||
g_error ("prlimit failed: %s", g_strerror (ret));
|
g_error ("prlimit failed: %s", g_strerror (errno));
|
||||||
|
|
||||||
error = NULL;
|
error = NULL;
|
||||||
thread = g_thread_try_new ("a", thread1_func, NULL, &error);
|
thread = g_thread_try_new ("a", thread1_func, NULL, &error);
|
||||||
@ -156,7 +157,7 @@ test_thread4 (void)
|
|||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
|
|
||||||
if ((ret = prlimit (getpid (), RLIMIT_NPROC, &ol, NULL)) != 0)
|
if ((ret = prlimit (getpid (), RLIMIT_NPROC, &ol, NULL)) != 0)
|
||||||
g_error ("resetting RLIMIT_NPROC failed: %s", g_strerror (ret));
|
g_error ("resetting RLIMIT_NPROC failed: %s", g_strerror (errno));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user