Skip to content

Commit

Permalink
Fix: test was failing if sem_destroy returned error EBUSY
Browse files Browse the repository at this point in the history
  • Loading branch information
rocso committed Dec 21, 2016
1 parent afc31b7 commit 1ebc946
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/semaphore5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 1ebc946

Please sign in to comment.