summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab_parse.c
diff options
context:
space:
mode:
authorKarel Zak2013-04-03 16:14:03 +0200
committerKarel Zak2013-04-03 16:14:03 +0200
commit1eb8539d3b1d2cb636bb73222daeb0bf4f68d7ae (patch)
treed2d8c594952d8abd82c42df4b610fbdd82fc1932 /libmount/src/tab_parse.c
parentlibuuid: use O_CLOEXEC (diff)
downloadkernel-qcow2-util-linux-1eb8539d3b1d2cb636bb73222daeb0bf4f68d7ae.tar.gz
kernel-qcow2-util-linux-1eb8539d3b1d2cb636bb73222daeb0bf4f68d7ae.tar.xz
kernel-qcow2-util-linux-1eb8539d3b1d2cb636bb73222daeb0bf4f68d7ae.zip
libmount: use O_CLOEXEC
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libmount/src/tab_parse.c')
-rw-r--r--libmount/src/tab_parse.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c
index b4b647075..7368d8c98 100644
--- a/libmount/src/tab_parse.c
+++ b/libmount/src/tab_parse.c
@@ -579,7 +579,7 @@ int mnt_table_parse_file(struct libmnt_table *tb, const char *filename)
if (!filename || !tb)
return -EINVAL;
- f = fopen(filename, "r");
+ f = fopen(filename, "r" UL_CLOEXECSTR);
if (f) {
rc = mnt_table_parse_stream(tb, f, filename);
fclose(f);
@@ -639,7 +639,7 @@ static int __mnt_table_parse_dir(struct libmnt_table *tb, const char *dirname)
!S_ISREG(st.st_mode))
continue;
- f = fopen_at(dd, ".", d->d_name, O_RDONLY, "r");
+ f = fopen_at(dd, ".", d->d_name, O_RDONLY|O_CLOEXEC, "r" UL_CLOEXECSTR);
if (f) {
mnt_table_parse_stream(tb, f, d->d_name);
fclose(f);
@@ -679,8 +679,8 @@ static int __mnt_table_parse_dir(struct libmnt_table *tb, const char *dirname)
!S_ISREG(st.st_mode))
continue;
- f = fopen_at(dirfd(dir), _PATH_MNTTAB_DIR,
- d->d_name, O_RDONLY, "r");
+ f = fopen_at(dirfd(dir), _PATH_MNTTAB_DIR, d->d_name,
+ O_RDONLY|O_CLOEXEC, "r" UL_CLOEXECSTR);
if (f) {
mnt_table_parse_stream(tb, f, d->d_name);
fclose(f);