From: Jens Axboe Date: Mon, 14 Apr 2014 18:14:17 +0000 (-0600) Subject: gettime: handle pthread_create() failure X-Git-Tag: fio-2.1.9~33 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=6b0110cdf045b64b448ae3488c75897eddf8f090;p=fio.git gettime: handle pthread_create() failure Signed-off-by: Jens Axboe --- 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++) {