[systemd-commits] src/login src/shared

Lennart Poettering lennart at kemper.freedesktop.org
Tue May 13 07:41:40 PDT 2014


 src/login/inhibit.c  |    2 +-
 src/shared/install.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ead349509e325aad720bb0349521a9e56e2ac7c0
Author: Lennart Poettering <lennart at poettering.net>
Date:   Tue May 13 16:40:53 2014 +0200

    replace more dup() by F_DUPFD_CLOEXEC

diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index 48c2ec4..ae3afdf 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -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;
 
diff --git a/src/shared/install.c b/src/shared/install.c
index acfba25..9ce9403 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -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;



More information about the systemd-commits mailing list