From 722f4284b2428744049db1ba3b32ada41cf8883c Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Thu, 19 Sep 2024 02:36:53 +0900 Subject: [PATCH] tests: (test_mkfds) fix the way to detect errors in fork(2) Signed-off-by: Masatake YAMATO --- tests/helpers/test_mkfds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c index b7f120a2c..7036eed6a 100644 --- a/tests/helpers/test_mkfds.c +++ b/tests/helpers/test_mkfds.c @@ -2358,7 +2358,7 @@ static void *make_eventfd(const struct factory *factory _U_, struct fdesc fdescs signal(SIGCHLD, abort_with_child_death_message); *pid = fork(); - if (*pid < -1) { + if (*pid < 0) { int e = errno; close(fdescs[0].fd); close(fdescs[1].fd); @@ -2564,7 +2564,7 @@ static void *make_mqueue(const struct factory *factory, struct fdesc fdescs[], signal(SIGCHLD, abort_with_child_death_message); mqueue_data->pid = fork(); - if (mqueue_data->pid < -1) { + if (mqueue_data->pid < 0) { int e = errno; mq_close(fdescs[0].fd); mq_close(fdescs[1].fd); -- 2.47.3