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

[tor-commits] [tor/master] set_managed_proxy_environment() can't fail anymore



commit 93414707aec510c253cf150b654b04dab45cf9e9
Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date:   Sun Feb 12 06:57:35 2012 +0100

    set_managed_proxy_environment() can't fail anymore
    
    It already couldn't fail on Windows, now it can't fail on non-Windows,
    either.
---
 src/or/transports.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/or/transports.c b/src/or/transports.c
index 77d3a86..7bdb88a 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -95,7 +95,7 @@
 static void set_managed_proxy_environment(LPVOID *envp,
                                           const managed_proxy_t *mp);
 #else
-static int set_managed_proxy_environment(char ***envp,
+static void set_managed_proxy_environment(char ***envp,
                                          const managed_proxy_t *mp);
 #endif
 
@@ -305,12 +305,8 @@ launch_managed_proxy(managed_proxy_t *mp)
   char **envp=NULL;
 
   /* prepare the environment variables for the managed proxy */
-  if (set_managed_proxy_environment(&envp, mp) < 0) {
-    log_warn(LD_GENERAL, "Could not setup the environment of "
-             "the managed proxy at '%s'.", mp->argv[0]);
-    free_execve_args(envp);
-    return -1;
-  }
+  set_managed_proxy_environment(&envp, mp);
+  tor_assert(envp);
 
   retval = tor_spawn_background(mp->argv[0], (const char **)mp->argv,
                                 (const char **)envp, &mp->process_handle);
@@ -1082,7 +1078,7 @@ extern char **environ;
 /** Prepare the environment <b>envp</b> of managed proxy <b>mp</b>.
  *  <b>envp</b> is allocated on the heap and should be freed by the
  *  caller after its use. */
-static int
+static void
 set_managed_proxy_environment(char ***envp, const managed_proxy_t *mp)
 {
   const or_options_t *options = get_options();
@@ -1093,7 +1089,6 @@ set_managed_proxy_environment(char ***envp, const managed_proxy_t *mp)
   int environ_size=0;
   char **environ_tmp = environ;
 
-  int r = -1;
   int n_envs = mp->is_server ? ENVIRON_SIZE_SERVER : ENVIRON_SIZE_CLIENT;
 
   while (*environ_tmp) {
@@ -1130,13 +1125,9 @@ set_managed_proxy_environment(char ***envp, const managed_proxy_t *mp)
   }
   *tmp = NULL;
 
-  r = 0;
-
   tor_free(state_loc);
   tor_free(transports_to_launch);
   tor_free(bindaddr);
-
-  return r;
 }
 
 #endif /* _WIN32 */



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