[or-cvs] Make sequence of log messages when starting on win32 with n...

Nick Mathewson nickm at seul.org
Tue Jan 4 02:25:39 UTC 2005


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

Modified Files:
	config.c 
Log Message:
Make sequence of log messages when starting on win32 with no config file more reasonable.

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.291
retrieving revision 1.292
diff -u -d -r1.291 -r1.292
--- config.c	3 Jan 2005 23:21:32 -0000	1.291
+++ config.c	4 Jan 2005 02:25:36 -0000	1.292
@@ -1669,6 +1669,7 @@
       fname = fn;
     } else {
       tor_free(fn);
+#ifndef MS_WINDOWS
       fn = expand_filename("~/.torrc");
       if (fn && file_status(fn) == FN_FILE) {
         fname = fn;
@@ -1676,13 +1677,16 @@
         tor_free(fn);
         fname = get_default_conf_file();
       }
+#else
+      fname = get_default_conf_file();
+#endif
     }
   }
   tor_assert(fname);
   log(LOG_DEBUG, "Opening config file '%s'", fname);
 
-  cf = read_file_to_str(fname, 0);
-  if (!cf) {
+  if (file_status(fname) != FN_FILE ||
+      !(cf = read_file_to_str(fname,0))) {
     if (using_default_torrc == 1) {
       log(LOG_NOTICE, "Configuration file '%s' not present, "
           "using reasonable defaults.", fname);



More information about the tor-commits mailing list