X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=gettime-thread.c;h=3d49034a72792fc6cfc590ed545c522de4f7a999;hp=da409042f2ec6eb7344b6f943dad0eba84c54cd1;hb=6780906feec87dff250d618c46ce8b9580a25069;hpb=8e600258bad065fbdfd6a1b2856077d12cd521e5 diff --git a/gettime-thread.c b/gettime-thread.c index da409042..3d49034a 100644 --- a/gettime-thread.c +++ b/gettime-thread.c @@ -6,7 +6,7 @@ #include "fio.h" #include "smalloc.h" -struct timeval *fio_tv; +struct timeval *fio_tv = NULL; int fio_gtod_offload = 0; int fio_gtod_cpu = -1; static pthread_t gtod_thread; @@ -14,12 +14,14 @@ static pthread_t gtod_thread; void fio_gtod_init(void) { fio_tv = smalloc(sizeof(struct timeval)); - assert(fio_tv); + if (!fio_tv) + log_err("fio: smalloc pool exhausted\n"); } static void fio_gtod_update(void) { - gettimeofday(fio_tv, NULL); + if (fio_tv) + gettimeofday(fio_tv, NULL); } static void *gtod_thread_main(void *data)