Add FIO_SIGQUIT engine option
For network engines, we need a signal to make it abort the connection
if it isn't already running. Otherwise fio would just stall on ctrl-c
before the connection was established.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.c b/fio.c
index fcd1528..355d873 100644
--- a/fio.c
+++ b/fio.c
@@ -73,13 +73,17 @@
for_each_td(td, i) {
if (group_id == TERMINATE_ALL || groupid == td->groupid) {
dprint(FD_PROCESS, "setting terminate on %d\n",td->pid);
+
+ td->terminate = 1;
+ td->o.start_delay = 0;
+
/*
* if the thread is running, just let it exit
*/
if (td->runstate < TD_RUNNING)
kill(td->pid, SIGQUIT);
- td->terminate = 1;
- td->o.start_delay = 0;
+ else if (td->io_ops->flags & FIO_SIGQUIT)
+ kill(td->pid, SIGQUIT);
}
}
}