From 1ebc946a39762a67dea11c31ce920f21ec193550 Mon Sep 17 00:00:00 2001 From: Ross Johnson Date: Wed, 21 Dec 2016 19:24:03 +1100 Subject: [PATCH] Fix: test was failing if sem_destroy returned error EBUSY --- tests/semaphore5.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/semaphore5.c b/tests/semaphore5.c index 3644b73..5ebcb35 100644 --- a/tests/semaphore5.c +++ b/tests/semaphore5.c @@ -95,7 +95,11 @@ main() assert(pthread_create(&t, NULL, thr, (void *)&s) == 0); assert(sem_wait(&s) == 0); - assert(sem_destroy(&s) == 0); + /* + * Normally we would retry this next, but we're only + * interested in unexpected results in this test. + */ + assert(sem_destroy(&s) == 0 || errno == EBUSY); assert(pthread_join(t, NULL) == 0);