From a61cac5b6474494fe5c409b82d09236c45856b07 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 3 Apr 2013 16:13:55 +0200 Subject: libuuid: use O_CLOEXEC Signed-off-by: Karel Zak --- libuuid/src/gen_uuid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libuuid') 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; -- cgit v1.2.3-55-g7522