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

[or-cvs] Flush the logfd after we print "Tor opening log file", so w...



Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv1162

Modified Files:
	log.c 
Log Message:
Flush the logfd after we print "Tor opening log file", so we don't see those messages days later

Index: log.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/log.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- log.c	20 Nov 2004 12:17:19 -0000	1.74
+++ log.c	24 Nov 2004 08:42:06 -0000	1.75
@@ -104,7 +104,8 @@
   n = _log_prefix(buf, sizeof(buf), LOG_NOTICE);
   tor_snprintf(buf+n, sizeof(buf)-n,
                "Tor %s opening %slog file.\n", VERSION, is_new?"new ":"");
-  if (fputs(buf, lf->file) == EOF)
+  if (fputs(buf, lf->file) == EOF ||
+     fflush(lf->file) == EOF) /* error */
     return -1; /* failed */
   return 0;
 }