chiark / gitweb /
replace more dup() by F_DUPFD_CLOEXEC
[elogind.git] / src / shared / install.c
index acfba25b245e9b8e89ccb0ba89b8f0813e43beb1..9ce94035b92096e316a051e5c66dae32827427cd 100644 (file)
@@ -332,7 +332,7 @@ static int remove_marked_symlinks(
                 int q, cfd;
                 deleted = false;
 
-                cfd = dup(fd);
+                cfd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
                 if (cfd < 0) {
                         r = -errno;
                         break;