summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-01-18 18:48:40 -0700
committerJens Axboe <axboe@kernel.dk>2019-01-18 18:48:40 -0700
commitbc4e4a7427352809a2c478411f812c71ecbee47e (patch)
treef29b7e4bb92e809e3c9ce99906a7125a36e1e8d1
parenta2fc9f13b52978ee0e5f16080fd0f42899aa15b4 (diff)
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 <axboe@kernel.dk>
-rw-r--r--test/poll.c10
1 files 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) {