From 0299a05618c1070bccb0bf8ef8d3c8a250d817a6 Mon Sep 17 00:00:00 2001 From: Masatake YAMATO Date: Sat, 28 Sep 2024 01:44:21 +0900 Subject: [PATCH] tests: (test_mkfds,refactor) simplify nested if conditions Signed-off-by: Masatake YAMATO --- tests/helpers/test_mkfds.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c index 38c39292c..a849d1b3f 100644 --- a/tests/helpers/test_mkfds.c +++ b/tests/helpers/test_mkfds.c @@ -2796,11 +2796,8 @@ static void *make_timerfd(const struct factory *factory, struct fdesc fdescs[], free_arg(&remaining); free_arg(&abstime); - if (babstime) { - int r = clock_gettime(clockid, &now); - if (r == -1) - err(EXIT_FAILURE, "failed in clock_gettime(2)"); - } + if (babstime && (clock_gettime(clockid, &now) == -1)) + err(EXIT_FAILURE, "failed in clock_gettime(2)"); tfd = timerfd_create(clockid, 0); if (tfd < 0) -- 2.47.3