aboutsummaryrefslogtreecommitdiff
path: root/src/common/log.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-07 15:20:50 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-07 15:20:50 -0500
commitba7d93db16fd53c951b6a159adeb7b4094817c11 (patch)
treeabe4ab2c73650426d9c8cbb4ffb7bf4efcd1b3b9 /src/common/log.c
parent0061d428900946ce8bf5c8bfb4c2b3b5faa4f691 (diff)
parentd3aabf4db176a44d19046b58b99f2edb8c5f49bb (diff)
downloadtor-ba7d93db16fd53c951b6a159adeb7b4094817c11.tar.gz
tor-ba7d93db16fd53c951b6a159adeb7b4094817c11.zip
Merge remote-tracking branch 'public/bug7816_023'
Conflicts: src/common/util.c
Diffstat (limited to 'src/common/log.c')
-rw-r--r--src/common/log.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/log.c b/src/common/log.c
index e56fb257f9..1ba8e6134e 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -833,8 +833,10 @@ add_file_log(const log_severity_list_t *severity, const char *filename)
fd = tor_open_cloexec(filename, O_WRONLY|O_CREAT|O_APPEND, 0644);
if (fd<0)
return -1;
- if (tor_fd_seekend(fd)<0)
+ if (tor_fd_seekend(fd)<0) {
+ close(fd);
return -1;
+ }
LOCK_LOGS();
add_stream_log_impl(severity, filename, fd);