summaryrefslogtreecommitdiff
path: root/gettime.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-04-14 12:14:17 -0600
committerJens Axboe <axboe@fb.com>2014-04-14 12:14:17 -0600
commit6b0110cdf045b64b448ae3488c75897eddf8f090 (patch)
tree77f62b9da442ecad30974f987425f235ee82448c /gettime.c
parentb1ed74e05bb8310832a7884f2d7125031375e377 (diff)
downloadfio-6b0110cdf045b64b448ae3488c75897eddf8f090.tar.gz
fio-6b0110cdf045b64b448ae3488c75897eddf8f090.tar.bz2
gettime: handle pthread_create() failure
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'gettime.c')
-rw-r--r--gettime.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gettime.c b/gettime.c
index 98e83b85..d261e22e 100644
--- a/gettime.c
+++ b/gettime.c
@@ -560,7 +560,11 @@ int fio_monotonic_clocktest(void)
pthread_mutex_init(&t->lock, NULL);
pthread_mutex_init(&t->started, NULL);
pthread_mutex_lock(&t->lock);
- pthread_create(&t->thread, NULL, clock_thread_fn, t);
+ if (pthread_create(&t->thread, NULL, clock_thread_fn, t)) {
+ failed++;
+ nr_cpus = i;
+ break;
+ }
}
for (i = 0; i < nr_cpus; i++) {