[tor-commits] [tor/release-0.3.1] Patch for 22720 from huyvq: exit(1) more often

nickm at torproject.org nickm at torproject.org
Mon Jun 26 18:16:07 UTC 2017


commit d72cfb259dfc83fe88c8589d4c1302a252823182
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Jun 26 14:14:56 2017 -0400

    Patch for 22720 from huyvq: exit(1) more often
    
    See changes file for full details.
---
 changes/bug22720 | 9 +++++++++
 src/or/control.c | 2 +-
 src/or/main.c    | 4 ++--
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/changes/bug22720 b/changes/bug22720
new file mode 100644
index 0000000..4893b57
--- /dev/null
+++ b/changes/bug22720
@@ -0,0 +1,9 @@
+  o Minor bugfixes (process behavior):
+    - When exiting because of an error, always exit with a nonzero
+      exit status. Previously, we would fail to report an error in
+      our exit status in cases related to lockfile contention,
+      __OwningControllerProcess failure, and Ed25519 key
+      initialization.  Fixes bug 22720; bugfix on versions
+      0.2.1.6-alpha, 0.2.2.28-beta, and 0.2.7.2-alpha
+      respectively. Reported by "f55jwk4f"; patch from "huyvq".
+
diff --git a/src/or/control.c b/src/or/control.c
index 9454a7a..9bcf1ee 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -6506,7 +6506,7 @@ monitor_owning_controller_process(const char *process_spec)
             msg);
     owning_controller_process_spec = NULL;
     tor_cleanup();
-    exit(0);
+    exit(1);
   }
 }
 
diff --git a/src/or/main.c b/src/or/main.c
index 9699c8d..cb24fd1 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1556,7 +1556,7 @@ check_ed_keys_callback(time_t now, const or_options_t *options)
           generate_ed_link_cert(options, now, new_signing_key > 0)) {
         log_err(LD_OR, "Unable to update Ed25519 keys!  Exiting.");
         tor_cleanup();
-        exit(0);
+        exit(1);
       }
     }
     return 30;
@@ -3168,7 +3168,7 @@ try_locking(const or_options_t *options, int err_if_locked)
         r = try_locking(options, 0);
         if (r<0) {
           log_err(LD_GENERAL, "No, it's still there.  Exiting.");
-          exit(0);
+          exit(1);
         }
         return r;
       }



More information about the tor-commits mailing list