diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-01-14 12:42:41 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-01-14 12:42:41 -0500 |
commit | c2dc94d8ebcd5fdd1076abb41ff0ecee6c092f4f (patch) | |
tree | 8806c17bfc9af54185570382ea629853dd801c15 /src/app/main/main.c | |
parent | dec11793ba2fdaeb975e1566b68846431fb85110 (diff) | |
parent | b6f099672b90cb606d89bfcb0cae01ea49e46b9c (diff) | |
download | tor-c2dc94d8ebcd5fdd1076abb41ff0ecee6c092f4f.tar.gz tor-c2dc94d8ebcd5fdd1076abb41ff0ecee6c092f4f.zip |
Merge branch 'ticket32883'
Diffstat (limited to 'src/app/main/main.c')
-rw-r--r-- | src/app/main/main.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/app/main/main.c b/src/app/main/main.c index 427c75fbc3..36f85c6a40 100644 --- a/src/app/main/main.c +++ b/src/app/main/main.c @@ -1238,15 +1238,10 @@ tor_run_main(const tor_main_configuration_t *tor_cfg) memcpy(argv + tor_cfg->argc, tor_cfg->argv_owned, tor_cfg->argc_owned*sizeof(char*)); -#ifdef NT_SERVICE - { - int done = 0; - result = nt_service_parse_options(argc, argv, &done); - if (done) { - goto done; - } - } -#endif /* defined(NT_SERVICE) */ + int done = 0; + result = nt_service_parse_options(argc, argv, &done); + if (done) + goto done; pubsub_install(); @@ -1279,11 +1274,16 @@ tor_run_main(const tor_main_configuration_t *tor_cfg) #endif } + if (tor_cfg->run_tor_only && get_options()->command != CMD_RUN_TOR) { + log_err(LD_CONFIG, "Unsupported command when running as an NT service."); + result = -1; + tor_cleanup(); + goto done; + } + switch (get_options()->command) { case CMD_RUN_TOR: -#ifdef NT_SERVICE nt_service_set_state(SERVICE_RUNNING); -#endif result = run_tor_main_loop(); break; case CMD_KEYGEN: |