Skip to content

Commit

Permalink
Report errno in case of sem_wait failure in GC_pthread_create
Browse files Browse the repository at this point in the history
Issue #97 (bdwgc).

* pthread_support.c (WRAP_FUNC(pthread_create)): Change ABORT() for
"sem_wait failed" case to ABORT_ARG1() to report errno as well.
  • Loading branch information
ivmai committed Feb 22, 2018
1 parent 0f831da commit 0034700
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pthread_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,8 @@ STATIC void * GC_start_routine(void * arg)
DISABLE_CANCEL(cancel_state);
/* pthread_create is not a cancellation point. */
while (0 != sem_wait(&(si -> registered))) {
if (EINTR != errno) ABORT("sem_wait failed");
if (EINTR != errno)
ABORT_ARG1("sem_wait failed", ": errcode= %d", errno);
}
RESTORE_CANCEL(cancel_state);
}
Expand Down

0 comments on commit 0034700

Please sign in to comment.