]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libuuid: use O_CLOEXEC
authorKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:13:55 +0000 (16:13 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Apr 2013 14:13:55 +0000 (16:13 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libuuid/src/gen_uuid.c

index 02e7f497e8360c07d9c8a6005ae78ff052fd8e46..387518a0c0c7deb78dbc48cd6a8f7a7e0be16863 100644 (file)
@@ -235,10 +235,10 @@ static int get_clock(uint32_t *clock_high, uint32_t *clock_low,
 
        if (state_fd == -2) {
                save_umask = umask(0);
-               state_fd = open(LIBUUID_CLOCK_FILE, O_RDWR|O_CREAT, 0660);
+               state_fd = open(LIBUUID_CLOCK_FILE, O_RDWR|O_CREAT|O_CLOEXEC, 0660);
                (void) umask(save_umask);
                if (state_fd != -1) {
-                       state_f = fdopen(state_fd, "r+");
+                       state_f = fdopen(state_fd, "r+" UL_CLOEXECSTR);
                        if (!state_f) {
                                close(state_fd);
                                state_fd = -1;