Handle ctrl-c properly with threads
A stupid bug, the main process should just ignore its own SIGQUIT.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/fio.c b/fio.c
index 08011c9..2aa8b40 100644
--- a/fio.c
+++ b/fio.c
@@ -116,6 +116,13 @@
}
}
+/*
+ * Happens on thread runs with ctrl-c, ignore our own SIGQUIT
+ */
+static void sig_quit(int sig)
+{
+}
+
static void sig_int(int sig)
{
if (threads) {
@@ -154,6 +161,11 @@
act.sa_handler = sig_ill;
act.sa_flags = SA_RESTART;
sigaction(SIGILL, &act, NULL);
+
+ memset(&act, 0, sizeof(act));
+ act.sa_handler = sig_quit;
+ act.sa_flags = SA_RESTART;
+ sigaction(SIGQUIT, &act, NULL);
}
static inline int should_check_rate(struct thread_data *td)