X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ffunctional%2Fvfork.c;h=4d5b4eaad255e7b4fe415066439d5530ae3ab264;hb=b55b931794bff9e88a3443daa8404c74f7f1d17c;hp=7ace682fad104632b292167c382ddf093a07168d;hpb=d18f448a9c4c7566f4e9cf1a29735226171cb50d;p=libc-test diff --git a/src/functional/vfork.c b/src/functional/vfork.c index 7ace682..4d5b4ea 100644 --- a/src/functional/vfork.c +++ b/src/functional/vfork.c @@ -36,22 +36,6 @@ static void test_exit(int code) TEST(WEXITSTATUS(r) == code, "child exited with %d, expected %d\n", WEXITSTATUS(r), code); } -static void test_kill(int sig) -{ - pid_t pid; - if((pid = vfork()) == 0) { - raise(sig); - t_error("raise failed: %s\n", strerror(errno)); - } - if (pid == -1) { - t_error("vfork failed: %s\n", strerror(errno)); - return; - } - int r = w(pid); - TEST(WIFSIGNALED(r), "child did not get killed\n"); - TEST(WTERMSIG(r) == sig, "child is killed by %d, expected %d\n", WTERMSIG(r), sig); -} - static int sh(const char *cmd) { pid_t pid; @@ -84,9 +68,8 @@ static void test_shell_kill(const char *cmd, int sig) int main() { test_exit(0); test_exit(1); - test_kill(SIGKILL); test_shell_exit("exit 0", 0); test_shell_exit("exit 1", 1); - test_shell_kill("kill -s HUP $$", SIGHUP); + test_shell_kill("kill -9 $$", 9); return t_status; }