libfio: don't sent KILL signal to own process from signal handler
authorJens Axboe <axboe@kernel.dk>
Thu, 29 Nov 2012 13:24:34 +0000 (14:24 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 29 Nov 2012 13:24:34 +0000 (14:24 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
libfio.c

index 0cfd7f63fd72b2f2e3e4cd6f77eeb2857b4ddde1..ee5a0ead1707f66fc7418c2b0b964d72727912ee 100644 (file)
--- a/libfio.c
+++ b/libfio.c
@@ -162,6 +162,7 @@ void td_set_runstate(struct thread_data *td, int runstate)
 void fio_terminate_threads(int group_id)
 {
        struct thread_data *td;
+       pid_t pid = getpid();
        int i;
 
        dprint(FD_PROCESS, "terminate group_id=%d\n", group_id);
@@ -180,7 +181,7 @@ void fio_terminate_threads(int group_id)
                                continue;
                        else if (td->runstate < TD_RAMP)
                                kill(td->pid, SIGTERM);
-                       else {
+                       else if (pid != td->pid) {
                                struct ioengine_ops *ops = td->io_ops;
 
                                if (ops && (ops->flags & FIO_SIGTERM))