chiark / gitweb /
replace more dup() by F_DUPFD_CLOEXEC
[elogind.git] / src / shared / install.c
index 6334833812a688ba24010f0eb2bdbcb2f465a8f4..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;
@@ -1494,8 +1494,8 @@ int unit_file_enable(
         supposed to be created, not the ones actually created. This is
         useful to determine whether the passed files had any
         installation data at all. */
-        r = install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes);
-        return r;
+
+        return install_context_apply(&c, &paths, config_path, root_dir, force, changes, n_changes);
 }
 
 int unit_file_disable(