X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fio.c;h=0ef039ddb03feef70c7976cf4438200a0c5f4ca3;hp=5a40004f5c4dea4c974dcd6c489033b83595be31;hb=f42c153d303be537f2963b633013a0ae1ef4de65;hpb=29adda3ce304f16036cafee6c099aa08444a7db1 diff --git a/fio.c b/fio.c index 5a40004f..0ef039dd 100644 --- a/fio.c +++ b/fio.c @@ -1274,12 +1274,17 @@ static void *gtod_thread_main(void *data) static int fio_start_gtod_thread(void) { - if (pthread_create(>od_thread, NULL, gtod_thread_main, NULL)) { - perror("Can't create gtod thread"); + int ret; + + ret = pthread_create(>od_thread, NULL, gtod_thread_main, NULL); + if (ret) { + log_err("Can't create gtod thread: %s\n", strerror(ret)); return 1; } - if (pthread_detach(gtod_thread) < 0) { - perror("Can't detatch gtod thread"); + + ret = pthread_detach(gtod_thread); + if (ret) { + log_err("Can't detatch gtod thread: %s\n", strerror(ret)); return 1; } @@ -1407,15 +1412,21 @@ static void run_threads(void) nr_started++; if (td->o.use_thread) { + int ret; + dprint(FD_PROCESS, "will pthread_create\n"); - if (pthread_create(&td->thread, NULL, - thread_main, td)) { - perror("pthread_create"); + ret = pthread_create(&td->thread, NULL, + thread_main, td); + if (ret) { + log_err("pthread_create: %s\n", + strerror(ret)); nr_started--; break; } - if (pthread_detach(td->thread) < 0) - perror("pthread_detach"); + ret = pthread_detach(td->thread); + if (ret) + log_err("pthread_detach: %s", + strerror(ret)); } else { pid_t pid; dprint(FD_PROCESS, "will fork\n");