chiark / gitweb /
replace more dup() by F_DUPFD_CLOEXEC
authorLennart Poettering <lennart@poettering.net>
Tue, 13 May 2014 14:40:53 +0000 (16:40 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 13 May 2014 14:40:53 +0000 (16:40 +0200)
src/login/inhibit.c
src/shared/install.c

index 48c2ec4..ae3afdf 100644 (file)
@@ -64,7 +64,7 @@ static int inhibit(sd_bus *bus, sd_bus_error *error) {
         if (r < 0)
                 return r;
 
-        r = dup(fd);
+        r = fcntl(fd, F_DUPFD_CLOEXEC, 3);
         if (r < 0)
                 return -errno;
 
index acfba25..9ce9403 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;