summaryrefslogtreecommitdiff
path: root/src/resolver.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2011-10-23 14:16:25 +0200
committerMarcel Holtmann <marcel@holtmann.org>2011-10-25 13:34:51 +0200
commitc94b607044db60e5ff6a4b0a861a90bee35b3bc0 (patch)
tree09d8a4eb547fe5e908127444d14613106a4c8fb7 /src/resolver.c
parentbd972fef32de3560bbe23ef41ba2281b696764fd (diff)
downloadconnman-c94b607044db60e5ff6a4b0a861a90bee35b3bc0.tar.gz
connman-c94b607044db60e5ff6a4b0a861a90bee35b3bc0.tar.bz2
connman-c94b607044db60e5ff6a4b0a861a90bee35b3bc0.zip
core: Add O_CLOEXEC to open()
Make sure all file descriptor are closed.
Diffstat (limited to 'src/resolver.c')
-rw-r--r--src/resolver.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolver.c b/src/resolver.c
index 59defd49..4cc87ddc 100644
--- a/src/resolver.c
+++ b/src/resolver.c
@@ -121,7 +121,7 @@ static int resolvfile_export(void)
old_umask = umask(022);
- fd = open("/etc/resolv.conf", O_RDWR | O_CREAT,
+ fd = open("/etc/resolv.conf", O_RDWR | O_CREAT | O_CLOEXEC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (fd < 0) {
err = -errno;