aboutsummaryrefslogtreecommitdiff
path: root/src/util/helper.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-10-29 16:14:03 +0000
committerChristian Grothoff <christian@grothoff.org>2012-10-29 16:14:03 +0000
commitbcbcf005b4864ac5557c31da10521126d8880849 (patch)
tree444cafefb16e1c5a4ba13ce2db07d6ec1f37675e /src/util/helper.c
parent119193d6350bbbd8c6ecbd60ccc8301223d6f6d6 (diff)
downloadgnunet-bcbcf005b4864ac5557c31da10521126d8880849.tar.gz
gnunet-bcbcf005b4864ac5557c31da10521126d8880849.zip
installing all service, daemon and helper binaries to lib/gnunet/libexec/; updating code to run binaries from new location, which is no longer in PATH
Diffstat (limited to 'src/util/helper.c')
-rw-r--r--src/util/helper.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/util/helper.c b/src/util/helper.c
index 03e71585c..c0681c804 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -131,7 +131,7 @@ struct GNUNET_HELPER_Handle
131 /** 131 /**
132 * Binary to run. 132 * Binary to run.
133 */ 133 */
134 const char *binary_name; 134 char *binary_name;
135 135
136 /** 136 /**
137 * NULL-terminated list of command-line arguments. 137 * NULL-terminated list of command-line arguments.
@@ -411,18 +411,17 @@ GNUNET_HELPER_start (int with_control_pipe,
411 void *cb_cls) 411 void *cb_cls)
412{ 412{
413 struct GNUNET_HELPER_Handle*h; 413 struct GNUNET_HELPER_Handle*h;
414 int c = 0; 414 unsigned int c;
415 h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle));
416 h->with_control_pipe = with_control_pipe;
417 h->binary_name = GNUNET_strdup (binary_name);
418 415
419 for (c = 0; binary_argv[c] != NULL; c++) 416 h = GNUNET_malloc (sizeof (struct GNUNET_HELPER_Handle));
420 c ++; 417 h->with_control_pipe = with_control_pipe;
421 h->binary_argv = GNUNET_malloc (sizeof (char *[c + 1])); 418 h->binary_name = GNUNET_OS_get_libexec_binary_path (binary_name);
422 for (c = 0; binary_argv[c] != NULL; c++) 419 for (c = 0; NULL != binary_argv[c]; c++)
420 c++;
421 h->binary_argv = GNUNET_malloc (sizeof (char *) * (c + 1));
422 for (c = 0; NULL != binary_argv[c]; c++)
423 h->binary_argv[c] = GNUNET_strdup (binary_argv[c]); 423 h->binary_argv[c] = GNUNET_strdup (binary_argv[c]);
424 h->binary_argv[c] = NULL; 424 h->binary_argv[c] = NULL;
425
426 h->cb_cls = cb_cls; 425 h->cb_cls = cb_cls;
427 h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls); 426 h->mst = GNUNET_SERVER_mst_create (cb, h->cb_cls);
428 h->exp_cb = exp_cb; 427 h->exp_cb = exp_cb;
@@ -440,7 +439,8 @@ void
440GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h) 439GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h)
441{ 440{
442 struct GNUNET_HELPER_SendHandle *sh; 441 struct GNUNET_HELPER_SendHandle *sh;
443 int c; 442 unsigned int c;
443
444 h->exp_cb = NULL; 444 h->exp_cb = NULL;
445 /* signal pending writes that we were stopped */ 445 /* signal pending writes that we were stopped */
446 while (NULL != (sh = h->sh_head)) 446 while (NULL != (sh = h->sh_head))
@@ -454,7 +454,7 @@ GNUNET_HELPER_stop (struct GNUNET_HELPER_Handle *h)
454 } 454 }
455 stop_helper (h); 455 stop_helper (h);
456 GNUNET_SERVER_mst_destroy (h->mst); 456 GNUNET_SERVER_mst_destroy (h->mst);
457 GNUNET_free ((char *) h->binary_name); 457 GNUNET_free (h->binary_name);
458 for (c = 0; h->binary_argv[c] != NULL; c++) 458 for (c = 0; h->binary_argv[c] != NULL; c++)
459 GNUNET_free (h->binary_argv[c]); 459 GNUNET_free (h->binary_argv[c]);
460 GNUNET_free (h->binary_argv); 460 GNUNET_free (h->binary_argv);