mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 05:18:00 +00:00
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 <dsafonov@virtuozzo.com> Acked-by: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
ae48b5d676
commit
8cae4bdcfa
@ -16,6 +16,7 @@ const char *test_author = "Tycho Andersen <tycho.andersen@canonical.com>";
|
||||
|
||||
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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ const char *test_author = "Andrew Vagin <avagin@parallels.com>";
|
||||
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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user