summaryrefslogtreecommitdiffstats
path: root/libmount/src/utils.c
diff options
context:
space:
mode:
authorKarel Zak2012-08-29 20:08:18 +0200
committerKarel Zak2012-09-04 16:49:28 +0200
commitd39c2b438f0f99481f4b14d01b859dd0ea4c6d03 (patch)
treebe9a5947519b82a6945451bdfe63ead3b72e6cde /libmount/src/utils.c
parentlibblkid: use O_CLOEXEC (diff)
downloadkernel-qcow2-util-linux-d39c2b438f0f99481f4b14d01b859dd0ea4c6d03.tar.gz
kernel-qcow2-util-linux-d39c2b438f0f99481f4b14d01b859dd0ea4c6d03.tar.xz
kernel-qcow2-util-linux-d39c2b438f0f99481f4b14d01b859dd0ea4c6d03.zip
libmount: use O_CLOEXEC everywhere
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/utils.c')
-rw-r--r--libmount/src/utils.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
index 63d1079d0..245a3b25d 100644
--- a/libmount/src/utils.c
+++ b/libmount/src/utils.c
@@ -610,8 +610,8 @@ static int try_write(const char *filename)
if (!filename)
return -EINVAL;
- fd = open(filename, O_RDWR|O_CREAT, S_IWUSR| \
- S_IRUSR|S_IRGRP|S_IROTH);
+ fd = open(filename, O_RDWR|O_CREAT|O_CLOEXEC,
+ S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH);
if (fd >= 0) {
close(fd);
return 0;