From f42316cb0b0b95fb5f03b93a32caf407cc5bd4ee Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 10 Jan 2023 12:48:32 +0000 Subject: [PATCH] tests: Improve error message if setting max processes to 1 fails This has historically failed on Debian autobuilders, and as a result we have had a patch for a long time that turned a failure here into a g_test_skip(). It's not clear whether this still happens, so I'm now assessing whether the patch can be dropped; but if the prlimit() call can fail for whatever reason, it would be useful for the error message to say what limit we were trying to set. Signed-off-by: Simon McVittie --- glib/tests/thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glib/tests/thread.c b/glib/tests/thread.c index 18bbde871..25c62cc6d 100644 --- a/glib/tests/thread.c +++ b/glib/tests/thread.c @@ -147,7 +147,8 @@ test_thread4 (void) nl.rlim_cur = 1; if (prlimit (getpid (), RLIMIT_NPROC, &nl, &ol) != 0) - g_error ("prlimit failed: %s", g_strerror (errno)); + g_error ("setting RLIMIT_NPROC to {cur=%ld,max=%ld} failed: %s", + (long) nl.rlim_cur, (long) nl.rlim_max, g_strerror (errno)); error = NULL; thread = g_thread_try_new ("a", thread1_func, NULL, &error);