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

[or-cvs] some more patching



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	config.c main.c 
Log Message:
some more patching


Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -d -r1.117 -r1.118
--- config.c	20 May 2004 08:15:28 -0000	1.117
+++ config.c	20 May 2004 08:41:54 -0000	1.118
@@ -757,6 +757,7 @@
       add_stream_log(levelMin, levelMax, "<stderr>", stderr);
       log_fn(LOG_WARN, "Cannot write to LogFile '%s': %s.", file_opt->value,
              strerror(errno));
+      return;
     }
     log_fn(LOG_NOTICE, "Successfully opened LogFile '%s', redirecting output.",
            file_opt->value);
@@ -775,8 +776,10 @@
   struct config_line_t *opt = options->LogOptions;
 
   /* Special case if nothing is specified. */
-  if(!opt)
+  if(!opt) {
     add_single_log(NULL, NULL, options->RunAsDaemon);
+    /* don't return yet, in case we want to do a debuglogfile below */
+  }
 
   /* Special case for if first option is LogLevel. */
   if (opt && !strcasecmp(opt->key, "LogLevel")) {

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.272
retrieving revision 1.273
diff -u -d -r1.272 -r1.273
--- main.c	20 May 2004 05:10:30 -0000	1.272
+++ main.c	20 May 2004 08:41:54 -0000	1.273
@@ -551,7 +551,6 @@
     log_fn(LOG_ERR,"Reading config failed. For usage, try -h.");
     return -1;
   }
-  close_logs(); /* we'll close, then open with correct loglevel if necessary */
 
   /* Setuid/setgid as appropriate */
   if(options.User || options.Group) {
@@ -565,6 +564,8 @@
     start_daemon(options.DataDirectory);
   }
 
+  close_logs(); /* we'll close, then open with correct loglevel if necessary */
+
   /* Configure the log(s) */
   config_init_logs(&options);
 
@@ -578,7 +579,7 @@
     finish_daemon();
   }
 
-  /* Write our pid to the pid file. if we do not have write permissions we
+  /* Write our pid to the pid file. If we do not have write permissions we
    * will log a warning */
   if(options.PidFile)
     write_pidfile(options.PidFile);
@@ -852,7 +853,7 @@
 int tor_main(int argc, char *argv[]) {
 
   /* give it somewhere to log to initially */
-  add_stream_log(LOG_INFO, LOG_ERR, "<stdout>", stdout);
+  add_stream_log(LOG_NOTICE, LOG_ERR, "<stdout>", stdout);
   log_fn(LOG_NOTICE,"Tor v%s. This is experimental software. Do not use it if you need anonymity.",VERSION);
 
   if (network_init()<0) {