From: Jiri P. <jpa...@we...> - 2009-06-22 01:19:38
|
Cleanup has to be made only once in the parent process; when the child makes the cleanup itself, the parent has nothing to cleanup, which makes him sad. Signed-off-by: Jiri Palecek <jpa...@we...> --- testcases/kernel/syscalls/setuid/setuid04.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/testcases/kernel/syscalls/setuid/setuid04.c b/testcases/kernel/syscalls/setuid/setuid04.c index 18f1d90..26a3868 100644 --- a/testcases/kernel/syscalls/setuid/setuid04.c +++ b/testcases/kernel/syscalls/setuid/setuid04.c @@ -114,7 +114,7 @@ void do_master_child() int status; if (setuid(ltpuser->pw_uid) == -1) { - tst_brkm(TBROK, cleanup, + tst_brkm(TBROK, tst_exit, "setuid failed to set the effective uid to %d", ltpuser->pw_uid); } @@ -143,7 +143,7 @@ void do_master_child() pid = FORK_OR_VFORK(); if (pid < 0) - tst_brkm(TBROK, cleanup, "Fork failed"); + tst_brkm(TBROK, tst_exit, "Fork failed"); if (pid == 0) { int tst_fd2; @@ -160,13 +160,12 @@ void do_master_child() if (TEST_ERRNO == EACCES) { tst_resm(TPASS, "open returned errno EACCES"); - exit(0); } else { tst_resm(TFAIL, "open returned unexpected errno - %d", TEST_ERRNO); - exit(-1); } + tst_exit(); } else { /* Wait for son completion */ waitpid(pid, &status, 0); -- 1.6.3.1 |