summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-09-23 04:32:43 +0000
committerRoger Dingledine <arma@torproject.org>2004-09-23 04:32:43 +0000
commit8727a281196a581d5932a5d04ce3981e9616db80 (patch)
tree914ce7e1d9300c3031486dacf4fee843eb8cd7bf
parentf753f6f0e21d859b513beb244e747a5c42a8d56f (diff)
downloadtor-8727a281196a581d5932a5d04ce3981e9616db80.tar.gz
tor-8727a281196a581d5932a5d04ce3981e9616db80.zip
bugfix: we were starting to daemonize before we opened our logs,
so if there were any problems opening logs, we would complain to stderr (which wouldn't work) and then mysteriously exit. svn:r2366
-rw-r--r--src/or/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 4a0ae66427..8076403940 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -690,11 +690,6 @@ static int init_from_config(int argc, char **argv) {
return -1;
}
- /* Start backgrounding the process, if requested. */
- if (options.RunAsDaemon) {
- start_daemon(get_data_directory(&options));
- }
-
/* Configure the log(s) */
if (config_init_logs(&options)<0)
return -1;
@@ -702,6 +697,11 @@ static int init_from_config(int argc, char **argv) {
* gone. */
close_temp_logs();
+ /* Start backgrounding the process, if requested. */
+ if (options.RunAsDaemon) {
+ start_daemon(get_data_directory(&options));
+ }
+
/* Set up our buckets */
connection_bucket_init();
stats_prev_global_read_bucket = global_read_bucket;