]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-fd-util: Replace dup() with fcntl()
authorDaan De Meyer <daan@amutable.com>
Fri, 20 Mar 2026 21:11:15 +0000 (22:11 +0100)
committerDaan De Meyer <daan@amutable.com>
Fri, 20 Mar 2026 21:11:15 +0000 (22:11 +0100)
Last remaining use of dup() in the codebase, let's get rid of it.

src/test/test-fd-util.c

index e99d7d04726b42c9857071b481b8aa60dab5c38f..338bbc29d07bc69af441ade7f32c02a886be2a53 100644 (file)
@@ -151,7 +151,7 @@ TEST(fd_move_above_stdio) {
         new_fd = fd_move_above_stdio(new_fd);
         assert_se(new_fd >= 3);
 
-        assert_se(dup(original_stdin) == 0);
+        assert_se(fcntl(original_stdin, F_DUPFD, 0) == 0);
         assert_se(close_nointr(original_stdin) != EBADF);
         assert_se(close_nointr(new_fd) != EBADF);
 }