diff options
author | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2011-10-23 14:16:23 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-10-25 13:34:06 +0200 |
commit | 4826f90b555f009972276be1fa945d81b435950a (patch) | |
tree | 2d62eda201ef154be4aeb869978685e9d99f1a24 /tools/stats-tool.c | |
parent | cb3e78500a2539a61d73ecb9708a2b06ea1f356d (diff) | |
download | connman-4826f90b555f009972276be1fa945d81b435950a.tar.gz connman-4826f90b555f009972276be1fa945d81b435950a.tar.bz2 connman-4826f90b555f009972276be1fa945d81b435950a.zip |
tools: Add O_CLOEXEC to open()
Make sure all file descriptor are closed.
Diffstat (limited to 'tools/stats-tool.c')
-rw-r--r-- | tools/stats-tool.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/stats-tool.c b/tools/stats-tool.c index cd48806f..0f06d8e6 100644 --- a/tools/stats-tool.c +++ b/tools/stats-tool.c @@ -470,7 +470,8 @@ static int stats_open(struct stats_file *file, const char *name) if (name != NULL) { 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 == -1) { fprintf(stderr, "open error %s for %s\n", strerror(errno), file->name); |