summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/shutdown_stress.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/shutdown_stress.cpp b/tests/shutdown_stress.cpp
index 27ab1f0..f106cc0 100644
--- a/tests/shutdown_stress.cpp
+++ b/tests/shutdown_stress.cpp
@@ -69,13 +69,18 @@ int XS_TEST_MAIN ()
for (i = 0; i != THREAD_COUNT; i++) {
s2 = xs_socket (ctx, XS_SUB);
- assert (s2);
- threads [i] = thread_create (shutdown_stress_worker, s2);
- assert (threads [i]);
+ if (!s2 && (errno == EMFILE || errno == ENFILE))
+ threads [i] = NULL;
+ else {
+ assert (s2);
+ threads [i] = thread_create (shutdown_stress_worker, s2);
+ assert (threads [i]);
+ }
}
for (i = 0; i != THREAD_COUNT; i++)
- thread_join (threads [i]);
+ if (threads [i])
+ thread_join (threads [i]);
rc = xs_close (s1);
assert (rc == 0);