]> granicus.if.org Git - gc/commitdiff
Report errno in case of sem_wait failure in GC_pthread_create
authorIvan Maidanski <ivmai@mail.ru>
Thu, 22 Feb 2018 21:34:39 +0000 (00:34 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 22 Feb 2018 21:35:42 +0000 (00:35 +0300)
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.

pthread_support.c

index 31066e77087dc7921f9514cb2367d2966f30c75f..935db03462248845c9e85cb3d41e57d51aa51288 100644 (file)
@@ -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);
     }