projects
/
libc-test
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d18f448
)
only test exec* and _exit after vfork, raise is not required to work
author
Szabolcs Nagy
<nsz@port70.net>
Wed, 8 Jan 2014 02:35:26 +0000
(
03:35
+0100)
committer
Szabolcs Nagy
<nsz@port70.net>
Wed, 8 Jan 2014 02:35:26 +0000
(
03:35
+0100)
src/functional/vfork.c
patch
|
blob
|
history
diff --git
a/src/functional/vfork.c
b/src/functional/vfork.c
index
7ace682
..
4d5b4ea
100644
(file)
--- 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);
}
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;
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);
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_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;
}
return t_status;
}