]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd/tests/sigalrm: Report thread creation failure
authorBart Van Assche <bvanassche@acm.org>
Thu, 2 Feb 2012 10:35:18 +0000 (10:35 +0000)
committerBart Van Assche <bvanassche@acm.org>
Thu, 2 Feb 2012 10:35:18 +0000 (10:35 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12364

drd/tests/sigalrm.c

index 38b979c560ca0f0270a266ebaf779eec1bd84a80..85987ab203d15784f1a033644d17296f2b06c8dd 100644 (file)
@@ -72,7 +72,10 @@ int main(int argc, char** argv)
     sigaction(SIGALRM, &sa, 0);
   }
 
-  pthread_create(&threadid, 0, thread_func, 0);
+  if (pthread_create(&threadid, 0, thread_func, 0) != 0) {
+    fprintf(stderr, "Thread creation failed\n");
+    return 1;
+  }
   // Wait until the thread is inside clock_nanosleep().
   tsDelay.tv_sec = 0;
   tsDelay.tv_nsec = 20 * 1000 * 1000;