Ignore exit_io_done= option if no I/O threads are configured
[fio.git] / libfio.c
index 55762d7be3cc99617c95e9981f9cc40413e3b4c0..25866758be9fac27001fdf9715e47f36fa6779dd 100644 (file)
--- a/libfio.c
+++ b/libfio.c
@@ -274,14 +274,18 @@ int fio_running_or_pending_io_threads(void)
 {
        struct thread_data *td;
        int i;
+       int nr_io_threads = 0;
 
        for_each_td(td, i) {
                if (td->flags & TD_F_NOIO)
                        continue;
+               nr_io_threads++;
                if (td->runstate < TD_EXITED)
                        return 1;
        }
 
+       if (!nr_io_threads)
+               return -1; /* we only had cpuio threads to begin with */
        return 0;
 }