From 8cae4bdcfa1312a2d6f73f15d54b3883ce9b0b36 Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Mon, 9 Jan 2017 20:19:10 +0300 Subject: [PATCH] zdtm/test: add infop to waitid() The man page says, it's not optional argument: The application shall ensure that the infop argument points to a siginfo_t structure. Fixes: Test output: ================================ 17:40:26.128: 5: FAIL: helper_zombie_child.c:33: waitid (errno = 14 (Bad address)) 17:40:26.128: 4: FAIL: helper_zombie_child.c:78: read (errno = 2 (No such file or directory)) 17:40:26.129: 3: ERR: test.c:229: Test exited unexpectedly with code 1 Test output: ================================ 15:30:49.021: 30: ERR: sigpending.c:213: waitid (errno = 14 (Bad address)) 15:30:49.021: 29: ERR: test.c:229: Test exited unexpectedly with code 1 and etc. travis-ci: success for 32-bit tests fixes Signed-off-by: Dmitry Safonov Acked-by: Tycho Andersen Signed-off-by: Pavel Emelyanov --- test/zdtm/static/helper_zombie_child.c | 3 ++- test/zdtm/static/sigpending.c | 3 ++- test/zdtm/static/stopped.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/zdtm/static/helper_zombie_child.c b/test/zdtm/static/helper_zombie_child.c index 18227189b..1e6b4bda7 100644 --- a/test/zdtm/static/helper_zombie_child.c +++ b/test/zdtm/static/helper_zombie_child.c @@ -16,6 +16,7 @@ const char *test_author = "Tycho Andersen "; void setsid_and_fork(int sk) { + siginfo_t infop; pid_t zombie; setsid(); @@ -29,7 +30,7 @@ void setsid_and_fork(int sk) if (zombie == 0) exit(0); - if (waitid(P_PID, zombie, NULL, WNOWAIT | WEXITED) < 0) { + if (waitid(P_PID, zombie, &infop, WNOWAIT | WEXITED) < 0) { fail("waitid"); exit(1); } diff --git a/test/zdtm/static/sigpending.c b/test/zdtm/static/sigpending.c index 2a4abfba0..d1dbd251d 100644 --- a/test/zdtm/static/sigpending.c +++ b/test/zdtm/static/sigpending.c @@ -170,6 +170,7 @@ int main(int argc, char ** argv) sigset_t blockmask, oldset, newset; struct sigaction act; pthread_t pthrd; + siginfo_t infop; int i; memset(&oldset, 0, sizeof(oldset)); @@ -209,7 +210,7 @@ int main(int argc, char ** argv) if(child == 0) return 5; /* SIGCHLD */ - if (waitid(P_PID, child, NULL, WNOWAIT | WEXITED)) { + if (waitid(P_PID, child, &infop, WNOWAIT | WEXITED)) { pr_perror("waitid"); return 1; } diff --git a/test/zdtm/static/stopped.c b/test/zdtm/static/stopped.c index af5780793..9bb849363 100644 --- a/test/zdtm/static/stopped.c +++ b/test/zdtm/static/stopped.c @@ -13,6 +13,7 @@ const char *test_author = "Andrew Vagin "; int main(int argc, char **argv) { pid_t pid; + siginfo_t infop; int p[2], ret, status; test_init(argc, argv); @@ -40,7 +41,7 @@ int main(int argc, char **argv) close(p[0]); kill(pid, SIGSTOP); - if (waitid(P_PID, pid, NULL, WNOWAIT | WSTOPPED) < 0) { + if (waitid(P_PID, pid, &infop, WNOWAIT | WSTOPPED) < 0) { pr_perror("waitid"); return 1; }