gettime-thread: fix failure to check setaffinity return value
authorJens Axboe <axboe@kernel.dk>
Fri, 1 Dec 2017 02:41:22 +0000 (19:41 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 1 Dec 2017 02:41:22 +0000 (19:41 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
gettime-thread.c

index cbb81dc..fc52236 100644 (file)
@@ -42,10 +42,17 @@ struct gtod_cpu_data {
 static void *gtod_thread_main(void *data)
 {
        struct fio_mutex *mutex = data;
+       int ret;
+
+       ret = fio_setaffinity(gettid(), fio_gtod_cpumask);
 
-       fio_setaffinity(gettid(), fio_gtod_cpumask);
        fio_mutex_up(mutex);
 
+       if (ret == -1) {
+               log_err("gtod: setaffinity failed\n");
+               return NULL;
+       }
+
        /*
         * As long as we have jobs around, update the clock. It would be nice
         * to have some way of NOT hammering that CPU with gettimeofday(),