]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: (test_mkfds,refactor) simplify nested if conditions
authorMasatake YAMATO <yamato@redhat.com>
Fri, 27 Sep 2024 16:44:21 +0000 (01:44 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Fri, 27 Sep 2024 16:44:21 +0000 (01:44 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/helpers/test_mkfds.c

index 38c39292ccf006c5ccea5dabc071fcbe052133f6..a849d1b3f2fb16dbe033af2fcbc696651dec1c82 100644 (file)
@@ -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)