Avoid "ts" going out of scope.
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index fd25dfe704423dc989ef36df741efab67283d609..2b18e9f8a9a606c349304d843156f2b9a26025d0 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -711,12 +711,10 @@ long io_u_queued_complete(struct thread_data *td, int min_events)
        struct io_completion_data icd;
        struct timespec *tvp = NULL;
        int ret;
+       struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, };
 
-       if (!min_events) {
-               struct timespec ts = { .tv_sec = 0, .tv_nsec = 0, };
-
+       if (!min_events)
                tvp = &ts;
-       }
 
        ret = td_io_getevents(td, min_events, td->cur_depth, tvp);
        if (ret < 0) {