[tor-commits] [obfsproxy/master] Fix obfsproxy's return codes.

nickm at torproject.org nickm at torproject.org
Fri Sep 9 17:08:59 UTC 2011


commit 4c86afb3968eea417ed4c290445f732d3a228642
Author: George Kadianakis <desnacked at gmail.com>
Date:   Mon Aug 22 00:07:56 2011 +0200

    Fix obfsproxy's return codes.
---
 src/external.c |    3 +--
 src/main.c     |    6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/external.c b/src/external.c
index 35b1315..e05deca 100644
--- a/src/external.c
+++ b/src/external.c
@@ -51,7 +51,7 @@ launch_external_proxy(const char *const *begin)
     } else {
       config_t *cfg = config_create(end - begin, begin);
       if (!cfg)
-        return 2; /* diagnostic already issued */
+        return -1; /* diagnostic already issued */
       smartlist_add(configs, cfg);
     }
     begin = end;
@@ -65,7 +65,6 @@ launch_external_proxy(const char *const *begin)
   SMARTLIST_FOREACH(configs, config_t *, cfg, {
     if (!open_listeners(get_event_base(), cfg)) {
       log_error("Failed to open listeners for configuration %d", cfg_sl_idx+1);
-      return 1;
     }
   });
 
diff --git a/src/main.c b/src/main.c
index 8e76d9c..c7515a2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -253,11 +253,11 @@ obfs_main(int argc, const char *const *argv)
   begin = argv + handle_obfsproxy_args(argv);
 
   if (is_external_proxy) {
-    if (launch_external_proxy(begin))
-      return 0;
+    if (launch_external_proxy(begin) < 0)
+      return 1;
   } else {
     if (launch_managed_proxy() < 0)
-      return 0;
+      return 1;
   }
 
   return 0;





More information about the tor-commits mailing list