From bc4e4a7427352809a2c478411f812c71ecbee47e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 18 Jan 2019 18:48:40 -0700 Subject: test/poll: ignore parent dying The parent may well die before the child is done, as long as it wrote to the pipe, we're fine. Signed-off-by: Jens Axboe --- test/poll.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/poll.c b/test/poll.c index ee1f8ec..c0a66cc 100644 --- a/test/poll.c +++ b/test/poll.c @@ -21,11 +21,11 @@ static void sig_alrm(int sig) int main(int argc, char *argv[]) { - pid_t parent = getpid(), p; struct io_uring_cqe *cqe; struct io_uring_sqe *sqe; struct io_uring ring; int pipe1[2]; + pid_t p; int ret; if (pipe(pipe1) != 0) { @@ -69,11 +69,11 @@ int main(int argc, char *argv[]) } do { - if (getppid() != parent) { - printf("parent died\n"); - exit(2); - } ret = io_uring_wait_completion(&ring, &cqe); + if (ret < 0) { + printf("child: wait completion %d\n", ret); + break; + } } while (ret != 0); if (ret < 0) { -- cgit