From: Karel Zak Date: Wed, 3 Apr 2013 14:13:55 +0000 (+0200) Subject: libuuid: use O_CLOEXEC X-Git-Tag: v2.23-rc2~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a61cac5b6474494fe5c409b82d09236c45856b07;p=thirdparty%2Futil-linux.git libuuid: use O_CLOEXEC Signed-off-by: Karel Zak --- diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c index 02e7f497e8..387518a0c0 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;