summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Kacur <jkacur@redhat.com>2015-09-30 23:09:41 +0200
committerJohn Kacur <jkacur@redhat.com>2015-10-05 20:21:15 +0200
commit40502982ccaaa718c5b14bdb41225f8373316b1e (patch)
tree59a5c98b5994d0c56bf69fd1e6132d1ec39db5ee
parentaa958b4d6e9e63c989dc11cfc152bd60a2bc3371 (diff)
downloadrt-tests-40502982ccaaa718c5b14bdb41225f8373316b1e.tar.gz
signaltest: Check the status of pthread_create
Check the status of pthread_create to help debug signaltest Signed-off-by: John Kacur <jkacur@redhat.com>
-rw-r--r--src/signaltest/signaltest.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/signaltest/signaltest.c b/src/signaltest/signaltest.c
index 791df0e..2ee1929 100644
--- a/src/signaltest/signaltest.c
+++ b/src/signaltest/signaltest.c
@@ -27,6 +27,7 @@
#include <sys/time.h>
#include <sys/mman.h>
+#include "error.h"
#include "rt-utils.h"
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -316,6 +317,7 @@ int main(int argc, char **argv)
struct thread_param *par;
struct thread_stat *stat;
int i, ret = -1;
+ int status;
process_options(argc, argv);
@@ -366,7 +368,11 @@ int main(int argc, char **argv)
stat[i].max = -1000000;
stat[i].avg = 0.0;
stat[i].threadstarted = 1;
- pthread_create(&stat[i].thread, NULL, signalthread, &par[i]);
+ status = pthread_create(&stat[i].thread, NULL, signalthread,
+ &par[i]);
+ if (status)
+ fatal("failed to create thread %d: %s\n", i,
+ strerror(status));
}
while (!shutdown) {