summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-07-03 15:04:25 +0000
committerNick Mathewson <nickm@torproject.org>2008-07-03 15:04:25 +0000
commit5a48b4faac79703a33d4a1ef25094f5afa0d2e83 (patch)
treea38dd0118f09a766dd6e9b82ad2b450ae21daabb /src
parentaeca4d90ed7d6c215672387ffc49434122e9baa3 (diff)
downloadtor-5a48b4faac79703a33d4a1ef25094f5afa0d2e83.tar.gz
tor-5a48b4faac79703a33d4a1ef25094f5afa0d2e83.zip
r16690@tombo: nickm | 2008-07-03 11:03:39 -0400
Backport to 0.2.0: Fix for bug 742: do not use O_CREAT on 2-option version of open(). Especially do not use it on /dev/null. Fix from Michael Scherer. Bugfix on 0.0.2pre19 (wow). svn:r15627
Diffstat (limited to 'src')
-rw-r--r--src/common/util.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 6cf7d00f32..b57d8a9f8d 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -3092,8 +3092,7 @@ finish_daemon(const char *desired_cwd)
exit(1);
}
- nullfd = open("/dev/null",
- O_CREAT | O_RDWR | O_APPEND);
+ nullfd = open("/dev/null", O_RDWR | O_APPEND);
if (nullfd < 0) {
log_err(LD_GENERAL,"/dev/null can't be opened. Exiting.");
exit(1);