Fix segfault with client/server and minimal output
[fio.git] / backend.c
index 3df0133f3e56d1c2648580fccaf1b870847992f4..9012140de35bc33b8e9c555d03943cbc94a54f06 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -667,13 +667,13 @@ static int io_bytes_exceeded(struct thread_data *td)
        unsigned long long bytes, limit;
 
        if (td_rw(td))
-               bytes = td->this_io_bytes[DDIR_READ] + td->this_io_bytes[DDIR_WRITE];
+               bytes = td->io_issue_bytes[DDIR_READ] + td->io_issue_bytes[DDIR_WRITE];
        else if (td_write(td))
-               bytes = td->this_io_bytes[DDIR_WRITE];
+               bytes = td->io_issue_bytes[DDIR_WRITE];
        else if (td_read(td))
-               bytes = td->this_io_bytes[DDIR_READ];
+               bytes = td->io_issue_bytes[DDIR_READ];
        else
-               bytes = td->this_io_bytes[DDIR_TRIM];
+               bytes = td->io_issue_bytes[DDIR_TRIM];
 
        if (td->o.io_limit)
                limit = td->o.io_limit;
@@ -2104,18 +2104,11 @@ static void *helper_thread_main(void *data)
                uint64_t sec = DISK_UTIL_MSEC / 1000;
                uint64_t nsec = (DISK_UTIL_MSEC % 1000) * 1000000;
                struct timespec ts;
-
-#if defined(CONFIG_CLOCK_MONOTONIC)
-               clock_gettime(CLOCK_MONOTONIC, &ts);
-               ts.tv_sec += sec;
-               ts.tv_nsec += nsec;
-#else
                struct timeval tv;
 
                gettimeofday(&tv, NULL);
                ts.tv_sec = tv.tv_sec + sec;
                ts.tv_nsec = (tv.tv_usec * 1000) + nsec;
-#endif
 
                if (ts.tv_nsec >= 1000000000ULL) {
                        ts.tv_nsec -= 1000000000ULL;