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

[or-cvs] Check that we can write to the logfile and log a warning to...



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

Modified Files:
	log.c 
Log Message:
Check that we can write to the logfile and log a warning to stderr if we can't
Move writing of pidfile after daemonizing, and also after setting the [ug]id:
This means that the tor user needs write priviliges to the pidfile location.
It needs it for unlinking the pidfile anyway.


Index: log.c
===================================================================
RCS file: /home/or/cvsroot/src/common/log.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- log.c	18 Oct 2003 00:07:58 -0000	1.27
+++ log.c	19 Nov 2003 02:09:43 -0000	1.28
@@ -150,6 +150,10 @@
   logfiles = lf;
 }
 
+/*
+ * If opening the logfile fails, -1 is returned and
+ * errno is set appropriately (by fopen)
+ */
 int add_file_log(int loglevel, const char *filename) 
 {
   FILE *f;