summaryrefslogtreecommitdiff
path: root/src/stats.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/stats.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/stats.c')
-rw-r--r--src/stats.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stats.c b/src/stats.c
index df28eb4a..828c1ef8 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -335,7 +335,7 @@ static int stats_open(struct stats_file *file,
file->name = g_strdup(name);
- file->fd = TFR(open(file->name, O_RDWR | O_CREAT, 0644));
+ file->fd = TFR(open(file->name, O_RDWR | O_CREAT | O_CLOEXEC, 0644));
if (file->fd < 0) {
connman_error("open error %s for %s",
strerror(errno), file->name);