From 48d86be55597762c6747081aae1936f49429d13b Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 30 Nov 2017 19:41:22 -0700 Subject: [PATCH] gettime-thread: fix failure to check setaffinity return value Signed-off-by: Jens Axboe --- gettime-thread.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gettime-thread.c b/gettime-thread.c index cbb81dc8..fc52236b 100644 --- a/gettime-thread.c +++ b/gettime-thread.c @@ -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(), -- 2.25.1