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

[tor-commits] [tor/master] Call run_tor_main_loop() in ntmain.c, rather than do_main_loop().



commit 1c2abea30a36c2b9e0e7e220542d17210bdd0b5e
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Dec 5 10:31:43 2018 -0500

    Call run_tor_main_loop() in ntmain.c, rather than do_main_loop().
    
    Fixes bug 28612; bugfix on 0.3.5.3-alpha.
---
 changes/bug28612      | 4 ++++
 src/app/main/main.c   | 2 +-
 src/app/main/main.h   | 2 ++
 src/app/main/ntmain.c | 4 ++--
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/changes/bug28612 b/changes/bug28612
new file mode 100644
index 000000000..559f25423
--- /dev/null
+++ b/changes/bug28612
@@ -0,0 +1,4 @@
+  o Minor bugfixes (windows services):
+    - Make Tor start correctly as an NT service again: previously it
+      was broken by refactoring.  Fixes bug 28612; bugfix on 0.3.5.3-alpha.
+      
diff --git a/src/app/main/main.c b/src/app/main/main.c
index ae87add67..a2b7c0845 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -1269,7 +1269,7 @@ sandbox_init_filter(void)
   return cfg;
 }
 
-static int
+int
 run_tor_main_loop(void)
 {
   handle_signals();
diff --git a/src/app/main/main.h b/src/app/main/main.h
index b64f2ef41..23a436703 100644
--- a/src/app/main/main.h
+++ b/src/app/main/main.h
@@ -26,4 +26,6 @@ void tor_free_all(int postfork);
 
 int tor_init(int argc, char **argv);
 
+int run_tor_main_loop(void);
+
 #endif /* !defined(TOR_MAIN_H) */
diff --git a/src/app/main/ntmain.c b/src/app/main/ntmain.c
index 800720a0b..8d2135a58 100644
--- a/src/app/main/ntmain.c
+++ b/src/app/main/ntmain.c
@@ -298,7 +298,7 @@ nt_service_body(int argc, char **argv)
   service_status.dwCurrentState = SERVICE_RUNNING;
   service_fns.SetServiceStatus_fn(hStatus, &service_status);
   set_main_thread();
-  do_main_loop();
+  run_tor_main_loop();
   tor_cleanup();
 }
 
@@ -326,7 +326,7 @@ nt_service_main(void)
         return;
       switch (get_options()->command) {
       case CMD_RUN_TOR:
-        do_main_loop();
+        run_tor_main_loop();
         break;
       case CMD_LIST_FINGERPRINT:
       case CMD_HASH_PASSWORD:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits