summaryrefslogtreecommitdiffstats
path: root/libuuid
diff options
context:
space:
mode:
authorKarel Zak2013-04-03 16:13:55 +0200
committerKarel Zak2013-04-03 16:13:55 +0200
commita61cac5b6474494fe5c409b82d09236c45856b07 (patch)
tree46682ceb12b683405d1f371c4057fb4840362ee2 /libuuid
parentlibfdisk: use O_CLOEXEC (diff)
downloadkernel-qcow2-util-linux-a61cac5b6474494fe5c409b82d09236c45856b07.tar.gz
kernel-qcow2-util-linux-a61cac5b6474494fe5c409b82d09236c45856b07.tar.xz
kernel-qcow2-util-linux-a61cac5b6474494fe5c409b82d09236c45856b07.zip
libuuid: use O_CLOEXEC
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libuuid')
-rw-r--r--libuuid/src/gen_uuid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c
index 02e7f497e..387518a0c 100644
--- a/libuuid/src/gen_uuid.c
+++ b/libuuid/src/gen_uuid.c
@@ -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;