aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-04-17 12:20:11 +0000
committerChristian Grothoff <christian@grothoff.org>2013-04-17 12:20:11 +0000
commit2b7a52a080e089e852b0a15da690b058e97bedc0 (patch)
treed2d2cf239ef64629960c215dfa1e2b4036485c61 /src/util
parent4a6d21c8e24895fe124e501ab68ffdb461204abe (diff)
downloadgnunet-2b7a52a080e089e852b0a15da690b058e97bedc0.tar.gz
gnunet-2b7a52a080e089e852b0a15da690b058e97bedc0.zip
set close-on-exec file for opened disk file descriptors
Diffstat (limited to 'src/util')
-rw-r--r--src/util/disk.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/util/disk.c b/src/util/disk.c
index e2c3594e5..bef35c899 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1729,7 +1729,11 @@ GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags,
1729 mode = translate_unix_perms (perm); 1729 mode = translate_unix_perms (perm);
1730 } 1730 }
1731 1731
1732 fd = open (expfn, oflags | O_LARGEFILE, mode); 1732 fd = open (expfn, oflags
1733#if O_CLOEXEC
1734 | O_CLOEXEC
1735#endif
1736 | O_LARGEFILE, mode);
1733 if (fd == -1) 1737 if (fd == -1)
1734 { 1738 {
1735 if (0 == (flags & GNUNET_DISK_OPEN_FAILIFEXISTS)) 1739 if (0 == (flags & GNUNET_DISK_OPEN_FAILIFEXISTS))