mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-23 18:19:39 +00:00
zdtm: Add infop to waitid() in pidns0{2,3}
As said in man page: > The application shall ensure that the infop argument > points to a siginfo_t structure. While x86_64 ignores NULL, ia32 syscall returns error: Test output: ================================ 20:52:47.176: 4: FAIL: pidns02.c:158: Can't wait (errno = 14 (Bad address)) 20:52:47.177: 4: FAIL: pidns02.c:183: Test failed (errno = 14 (Bad address)) 20:52:47.177: 3: ERR: test.c:228: Test exited unexpectedly with code 255 <<< ================================ Test output: ================================ 20:53:27.835: 1: FAIL: pidns03.c:119: Can't wait (errno = 14 (Bad address)) 20:53:28.207: 4: FAIL: pidns03.c:201: Can't wait or bad status: errno=0, status=32512 (errno = 0 (Success)) <<< ================================ Cc: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
8df85f8c51
commit
7d5ac8338d
2 changed files with 4 additions and 2 deletions
|
|
@ -103,6 +103,7 @@ int main(int argc, char **argv)
|
|||
int i, status, ret = -1;
|
||||
pid_t pid[] = {-1, -1};
|
||||
char *ns_pid, *tmp;
|
||||
siginfo_t infop;
|
||||
|
||||
test_init(argc, argv);
|
||||
futex = mmap(NULL, sizeof(*futex), PROT_WRITE | PROT_READ, MAP_SHARED | MAP_ANONYMOUS, -1, 0);
|
||||
|
|
@ -153,7 +154,7 @@ int main(int argc, char **argv)
|
|||
fail("Can't kill");
|
||||
goto out;
|
||||
}
|
||||
ret = waitid(P_PID, pid[1], NULL, WEXITED|WNOWAIT);
|
||||
ret = waitid(P_PID, pid[1], &infop, WEXITED|WNOWAIT);
|
||||
if (ret) {
|
||||
fail("Can't wait");
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ static int child_fn(void)
|
|||
{
|
||||
long thread_retval;
|
||||
pthread_t thread;
|
||||
siginfo_t infop;
|
||||
pid_t pid;
|
||||
int ret;
|
||||
|
||||
|
|
@ -114,7 +115,7 @@ static int child_fn(void)
|
|||
} else if (!pid)
|
||||
exit(0);
|
||||
|
||||
ret = waitid(P_PID, pid, NULL, WEXITED|WNOWAIT);
|
||||
ret = waitid(P_PID, pid, &infop, WEXITED|WNOWAIT);
|
||||
if (ret) {
|
||||
fail("Can't wait");
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue