OSDN Git Service

ktest: Wait for console process to exit
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 21 Mar 2018 14:24:20 +0000 (10:24 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Wed, 21 Mar 2018 14:24:20 +0000 (10:24 -0400)
To clean up the console processes that are forked to monitor the console,
there needs to be a waitpid().

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
tools/testing/ktest/ktest.pl

index 0c8b61f..4eece2a 100755 (executable)
@@ -1515,6 +1515,9 @@ sub close_console {
     doprint "kill child process $pid\n";
     kill $close_console_signal, $pid;
 
+    doprint "wait for child process $pid to exit\n";
+    waitpid($pid, 0);
+
     print "closing!\n";
     close($fp);