diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-11-05 10:44:29 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-11-05 10:44:29 +0000 |
commit | 0d5c03f33e0162b2a078d73ba693f397898022cb (patch) | |
tree | 2d74bf408bfd55f2736f4dac9ff754f061a51f2c /src/arm | |
parent | 0f8f8219d92f8f000aa662aa6beb3749f71f3486 (diff) | |
download | gnunet-0d5c03f33e0162b2a078d73ba693f397898022cb.tar.gz gnunet-0d5c03f33e0162b2a078d73ba693f397898022cb.zip |
-fix use of PREFIX with libexec
Diffstat (limited to 'src/arm')
-rw-r--r-- | src/arm/arm_api.c | 7 | ||||
-rw-r--r-- | src/arm/do_start_process.c | 3 | ||||
-rw-r--r-- | src/arm/gnunet-service-arm.c | 7 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index 15563e933..517938d8c 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c | |||
@@ -316,6 +316,7 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
316 | { | 316 | { |
317 | struct RequestContext *pos = cls; | 317 | struct RequestContext *pos = cls; |
318 | struct GNUNET_OS_Process *proc; | 318 | struct GNUNET_OS_Process *proc; |
319 | char *cbinary; | ||
319 | char *binary; | 320 | char *binary; |
320 | char *config; | 321 | char *config; |
321 | char *loprefix; | 322 | char *loprefix; |
@@ -344,7 +345,7 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
344 | lopostfix = GNUNET_strdup (""); | 345 | lopostfix = GNUNET_strdup (""); |
345 | if (GNUNET_OK != | 346 | if (GNUNET_OK != |
346 | GNUNET_CONFIGURATION_get_value_string (pos->h->cfg, "arm", "BINARY", | 347 | GNUNET_CONFIGURATION_get_value_string (pos->h->cfg, "arm", "BINARY", |
347 | &binary)) | 348 | &cbinary)) |
348 | { | 349 | { |
349 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, | 350 | GNUNET_log_config_missing (GNUNET_ERROR_TYPE_WARNING, |
350 | "arm", "BINARY"); | 351 | "arm", "BINARY"); |
@@ -363,12 +364,14 @@ arm_service_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
363 | "arm", "CONFIG"); | 364 | "arm", "CONFIG"); |
364 | if (pos->callback != NULL) | 365 | if (pos->callback != NULL) |
365 | pos->callback (pos->cls, GNUNET_ARM_PROCESS_UNKNOWN); | 366 | pos->callback (pos->cls, GNUNET_ARM_PROCESS_UNKNOWN); |
366 | GNUNET_free (binary); | 367 | GNUNET_free (cbinary); |
367 | GNUNET_free (pos); | 368 | GNUNET_free (pos); |
368 | GNUNET_free (loprefix); | 369 | GNUNET_free (loprefix); |
369 | GNUNET_free (lopostfix); | 370 | GNUNET_free (lopostfix); |
370 | return; | 371 | return; |
371 | } | 372 | } |
373 | binary = GNUNET_OS_get_libexec_binary_path (cbinary); | ||
374 | GNUNET_free (cbinary); | ||
372 | if ((GNUNET_YES == | 375 | if ((GNUNET_YES == |
373 | GNUNET_CONFIGURATION_have_value (pos->h->cfg, "TESTING", "WEAKRANDOM")) | 376 | GNUNET_CONFIGURATION_have_value (pos->h->cfg, "TESTING", "WEAKRANDOM")) |
374 | && (GNUNET_YES == | 377 | && (GNUNET_YES == |
diff --git a/src/arm/do_start_process.c b/src/arm/do_start_process.c index 0687fa345..b4bb10c6a 100644 --- a/src/arm/do_start_process.c +++ b/src/arm/do_start_process.c | |||
@@ -119,13 +119,12 @@ do_start_process (int pipe_control, unsigned int std_inheritance, | |||
119 | /* *INDENT-ON* */ | 119 | /* *INDENT-ON* */ |
120 | va_end (ap); | 120 | va_end (ap); |
121 | argv[argv_size] = NULL; | 121 | argv[argv_size] = NULL; |
122 | binary_path = GNUNET_OS_get_libexec_binary_path (argv[0]); | 122 | binary_path = argv[0]; |
123 | proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks, | 123 | proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks, |
124 | binary_path, argv); | 124 | binary_path, argv); |
125 | while (argv_size > 0) | 125 | while (argv_size > 0) |
126 | GNUNET_free (argv[--argv_size]); | 126 | GNUNET_free (argv[--argv_size]); |
127 | GNUNET_free (argv); | 127 | GNUNET_free (argv); |
128 | GNUNET_free (binary_path); | ||
129 | return proc; | 128 | return proc; |
130 | } | 129 | } |
131 | 130 | ||
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index 5ad409681..c30fc57c7 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -240,6 +240,7 @@ start_process (struct ServiceList *sl) | |||
240 | struct ServiceListeningInfo *sli; | 240 | struct ServiceListeningInfo *sli; |
241 | SOCKTYPE *lsocks; | 241 | SOCKTYPE *lsocks; |
242 | unsigned int ls; | 242 | unsigned int ls; |
243 | char *binary; | ||
243 | 244 | ||
244 | /* calculate listen socket list */ | 245 | /* calculate listen socket list */ |
245 | lsocks = NULL; | 246 | lsocks = NULL; |
@@ -311,17 +312,19 @@ start_process (struct ServiceList *sl) | |||
311 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 312 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
312 | "Starting service `%s' using binary `%s' and configuration `%s'\n", | 313 | "Starting service `%s' using binary `%s' and configuration `%s'\n", |
313 | sl->name, sl->binary, sl->config); | 314 | sl->name, sl->binary, sl->config); |
315 | binary = GNUNET_OS_get_libexec_binary_path (sl->binary); | ||
314 | GNUNET_assert (NULL == sl->proc); | 316 | GNUNET_assert (NULL == sl->proc); |
315 | if (GNUNET_YES == use_debug) | 317 | if (GNUNET_YES == use_debug) |
316 | sl->proc = | 318 | sl->proc = |
317 | do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 319 | do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
318 | lsocks, loprefix, sl->binary, "-c", sl->config, "-L", | 320 | lsocks, loprefix, binary, "-c", sl->config, "-L", |
319 | "DEBUG", options, NULL); | 321 | "DEBUG", options, NULL); |
320 | else | 322 | else |
321 | sl->proc = | 323 | sl->proc = |
322 | do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 324 | do_start_process (sl->pipe_control, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
323 | lsocks, loprefix, sl->binary, "-c", sl->config, | 325 | lsocks, loprefix, binary, "-c", sl->config, |
324 | options, NULL); | 326 | options, NULL); |
327 | GNUNET_free (binary); | ||
325 | if (sl->proc == NULL) | 328 | if (sl->proc == NULL) |
326 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to start service `%s'\n"), | 329 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Failed to start service `%s'\n"), |
327 | sl->name); | 330 | sl->name); |