]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
test: (mkfds::make-regular-file) make 'fd' local variable reusable
authorMasatake YAMATO <yamato@redhat.com>
Tue, 4 Jul 2023 14:55:22 +0000 (23:55 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Wed, 5 Jul 2023 04:51:11 +0000 (13:51 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/helpers/test_mkfds.c

index 8da4d4753dde7088be5bc5756958a95c2a491f86..3d7c9a88a2b7d8404ea7ddc30d092d88f24ad57b 100644 (file)
@@ -418,6 +418,7 @@ static void *make_w_regular_file(const struct factory *factory, struct fdesc fde
                        err(EXIT_FAILURE, "failed to dup %d -> %d", fd, fdescs[0].fd);
                }
                close(fd);
+               fd = fdescs[0].fd;
        }
 
        if (bDelete) {