Forced kill is not used anymore.
[fio.git] / fio.c
diff --git a/fio.c b/fio.c
index b668d856e9d3e9fd49c0ffc807ece26625f61d13..bf903d92c0c912aa05e8a3ecbe4e47bbc53f712c 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -60,17 +60,16 @@ static inline void td_set_runstate(struct thread_data *td, int runstate)
        td->runstate = runstate;
 }
 
-static void terminate_threads(int group_id, int forced_kill)
+static void terminate_threads(int group_id)
 {
        struct thread_data *td;
        int i;
 
        for_each_td(td, i) {
                if (group_id == TERMINATE_ALL || groupid == td->groupid) {
+                       kill(td->pid, SIGQUIT);
                        td->terminate = 1;
                        td->start_delay = 0;
-                       if (forced_kill)
-                               td_set_runstate(td, TD_EXITED);
                }
        }
 }
@@ -86,7 +85,7 @@ static void sig_handler(int sig)
                default:
                        printf("\nfio: terminating on signal %d\n", sig);
                        fflush(stdout);
-                       terminate_threads(TERMINATE_ALL, 0);
+                       terminate_threads(TERMINATE_ALL);
                        break;
        }
 }
@@ -490,7 +489,7 @@ requeue:
 
                if (check_min_rate(td, &comp_time)) {
                        if (exitall_on_terminate)
-                               terminate_threads(td->groupid, 0);
+                               terminate_threads(td->groupid);
                        td_verror(td, ENODATA, "check_min_rate");
                        break;
                }
@@ -807,7 +806,7 @@ static void *thread_main(void *data)
        }
 
        if (exitall_on_terminate)
-               terminate_threads(td->groupid, 0);
+               terminate_threads(td->groupid);
 
 err:
        if (td->error)
@@ -893,7 +892,8 @@ static void reap_threads(int *nr_running, int *t_rate, int *m_rate)
                        if (WIFSIGNALED(status)) {
                                int sig = WTERMSIG(status);
 
-                               log_err("fio: pid=%d, got signal=%d\n", td->pid, sig);
+                               if (sig != SIGQUIT)
+                                       log_err("fio: pid=%d, got signal=%d\n", td->pid, sig);
                                td_set_runstate(td, TD_REAPED);
                                goto reaped;
                        }
@@ -927,7 +927,7 @@ reaped:
        }
 
        if (*nr_running == cputhreads && !pending)
-               terminate_threads(TERMINATE_ALL, 0);
+               terminate_threads(TERMINATE_ALL);
 }
 
 /*