summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-01-04 02:25:36 +0000
committerNick Mathewson <nickm@torproject.org>2005-01-04 02:25:36 +0000
commit4d30e2f4b8b7178c77f95b0328ebbbb8b091646f (patch)
tree15da9fe54071ca61184cd34aab93e29db5c2aa00
parent1f3e77bf92cda37e1123bc5e0c28d411c2036be6 (diff)
downloadtor-4d30e2f4b8b7178c77f95b0328ebbbb8b091646f.tar.gz
tor-4d30e2f4b8b7178c77f95b0328ebbbb8b091646f.zip
Make sequence of log messages when starting on win32 with no config file more reasonable.
svn:r3275
-rw-r--r--src/or/config.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/config.c b/src/or/config.c
index bcae3c998d..8c6e74f381 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1669,6 +1669,7 @@ init_from_config(int argc, char **argv)
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 @@ init_from_config(int argc, char **argv)
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);