Fix killing of threads that haven't started
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index 2855ddf289748cf93e506aa7950aa82c2ac43e11..9e9106d55113b54785993649c38768824e6c755a 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -102,7 +102,9 @@ static void terminate_threads(int group_id)
                        /*
                         * if the thread is running, just let it exit
                         */
                        /*
                         * if the thread is running, just let it exit
                         */
-                       if (td->runstate < TD_RAMP)
+                       if (!td->pid)
+                               continue;
+                       else if (td->runstate < TD_RAMP)
                                kill(td->pid, SIGTERM);
                        else {
                                struct ioengine_ops *ops = td->io_ops;
                                kill(td->pid, SIGTERM);
                        else {
                                struct ioengine_ops *ops = td->io_ops;