summaryrefslogtreecommitdiff
path: root/tools/stats-tool.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/stats-tool.c')
-rw-r--r--tools/stats-tool.c3
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);