[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stegotorus/master] Don't use setvbuf - seems to cause memory corruption on OSX.



commit 6bcbcd65bcec8bab441f7410743d5dc19d11df63
Author: Zack Weinberg <zackw@xxxxxxx>
Date:   Wed Jun 20 00:14:19 2012 -0700

    Don't use setvbuf - seems to cause memory corruption on OSX.
---
 src/util.cc |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/util.cc b/src/util.cc
index c94275c..4fe576a 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -463,7 +463,6 @@ log_open(const char *filename)
 
   fputs("\nBrand new log:\n", log_dest);
   fflush(log_dest);
-  setvbuf(log_dest, NULL, _IOLBF, 0);
 
   return 0;
 }
@@ -496,7 +495,6 @@ log_set_method(int method, const char *filename)
 
   case LOG_METHOD_STDERR:
     log_dest = stderr;
-    setvbuf(log_dest, NULL, _IOLBF, 0);
     return 0;
 
   case LOG_METHOD_FILE:
@@ -556,6 +554,7 @@ logv(int severity, const char *format, va_list ap)
 
   vfprintf(log_dest, format, ap);
   putc('\n', log_dest);
+  fflush(log_dest);
 }
 
 static bool



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits