From: Masatake YAMATO Date: Wed, 18 Sep 2024 17:36:53 +0000 (+0900) Subject: tests: (test_mkfds) fix the way to detect errors in fork(2) X-Git-Tag: v2.42-start~195^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=722f4284b2428744049db1ba3b32ada41cf8883c;p=thirdparty%2Futil-linux.git tests: (test_mkfds) fix the way to detect errors in fork(2) Signed-off-by: Masatake YAMATO --- 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);