From: Gernot P. <gp...@su...> - 2004-04-21 10:20:19
|
Hi, in this file there is a line in cleanup() "kill(pid, SIGKILL);" where pid is the return code of a function, which starts a child process and returns the pid. Unfortunately in case of an error this function returns -1, so if ltp is run as root (quite probable) all processes except init are killed. This patch should prevent this case: --- ltp-full-20040405/testcases/kernel/syscalls/sendmsg/sendmsg01.c 2004-02-16 19:49:25.000000000 +0100 +++ ltp-new-20040405/testcases/kernel/syscalls/sendmsg/sendmsg01.c 2004-04-20 13:59:24.688430208 +0200 @@ -381,7 +381,8 @@ void cleanup(void) { - (void) kill(pid, SIGKILL); /* kill server */ + if(pid > 0) + (void) kill(pid, SIGKILL); /* kill server, if server exists */ unlink(tmpsunpath); TEST_CLEANUP; tst_rmdir(); mfg Gernot |