From: Masatake YAMATO Date: Fri, 27 Sep 2024 16:44:21 +0000 (+0900) Subject: tests: (test_mkfds,refactor) simplify nested if conditions X-Git-Tag: v2.42-start~188^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0299a05618c1070bccb0bf8ef8d3c8a250d817a6;p=thirdparty%2Futil-linux.git tests: (test_mkfds,refactor) simplify nested if conditions Signed-off-by: Masatake YAMATO --- 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)