diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2014-02-20 10:35:33 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2014-02-20 10:35:33 +0000 |
commit | 2a35e345a204cb357361406f28e07bf9076cb092 (patch) | |
tree | 8c51b5dae07a1f3a3a6a13ac6c623e0b0df2a070 /src | |
parent | a06237deeec4aed38b09f633d7ebbeabb7da4c03 (diff) | |
download | gnunet-2a35e345a204cb357361406f28e07bf9076cb092.tar.gz gnunet-2a35e345a204cb357361406f28e07bf9076cb092.zip |
Allow redirection of STDERR when starting processes.
Diffstat (limited to 'src')
32 files changed, 129 insertions, 53 deletions
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index b3674fdec..c570def84 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c | |||
@@ -301,7 +301,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
301 | p->cfg = GNUNET_CONFIGURATION_create (); | 301 | p->cfg = GNUNET_CONFIGURATION_create (); |
302 | p->arm_proc = | 302 | p->arm_proc = |
303 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 303 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
304 | NULL, NULL, | 304 | NULL, NULL, NULL, |
305 | binary, | 305 | binary, |
306 | "gnunet-service-arm", | 306 | "gnunet-service-arm", |
307 | "-c", cfgname, NULL); | 307 | "-c", cfgname, NULL); |
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index cb05fa9e5..fba153ade 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c | |||
@@ -419,9 +419,11 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
419 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 419 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
420 | p->cfg = GNUNET_CONFIGURATION_create (); | 420 | p->cfg = GNUNET_CONFIGURATION_create (); |
421 | p->arm_proc = | 421 | p->arm_proc = |
422 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 422 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
423 | "gnunet-service-arm", | 423 | NULL, NULL, NULL, |
424 | "-c", cfgname, NULL); | 424 | binary, |
425 | "gnunet-service-arm", | ||
426 | "-c", cfgname, NULL); | ||
425 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 427 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
426 | p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL); | 428 | p->th = GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, NULL, NULL); |
427 | GNUNET_assert (p->th != NULL); | 429 | GNUNET_assert (p->th != NULL); |
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c index 255de0319..3c14b01eb 100644 --- a/src/core/test_core_api_start_only.c +++ b/src/core/test_core_api_start_only.c | |||
@@ -134,7 +134,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
134 | p->cfg = GNUNET_CONFIGURATION_create (); | 134 | p->cfg = GNUNET_CONFIGURATION_create (); |
135 | p->arm_proc = | 135 | p->arm_proc = |
136 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 136 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
137 | NULL, NULL, | 137 | NULL, NULL, NULL, |
138 | binary, | 138 | binary, |
139 | "gnunet-service-arm", | 139 | "gnunet-service-arm", |
140 | "-c", cfgname, NULL); | 140 | "-c", cfgname, NULL); |
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 0e74fbef5..bf9197f0c 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c | |||
@@ -571,9 +571,11 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
571 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 571 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
572 | p->cfg = GNUNET_CONFIGURATION_create (); | 572 | p->cfg = GNUNET_CONFIGURATION_create (); |
573 | p->arm_proc = | 573 | p->arm_proc = |
574 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 574 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
575 | "gnunet-service-arm", | 575 | NULL, NULL, NULL, |
576 | "-c", cfgname, NULL); | 576 | binary, |
577 | "gnunet-service-arm", | ||
578 | "-c", cfgname, NULL); | ||
577 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 579 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
578 | p->stats = GNUNET_STATISTICS_create ("core", p->cfg); | 580 | p->stats = GNUNET_STATISTICS_create ("core", p->cfg); |
579 | GNUNET_assert (p->stats != NULL); | 581 | GNUNET_assert (p->stats != NULL); |
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c index 2106d67f1..ca9535d1b 100644 --- a/src/fs/gnunet-auto-share.c +++ b/src/fs/gnunet-auto-share.c | |||
@@ -488,7 +488,7 @@ work (void *cls, | |||
488 | _("Publishing `%s'\n"), | 488 | _("Publishing `%s'\n"), |
489 | wi->filename); | 489 | wi->filename); |
490 | publish_proc = GNUNET_OS_start_process_vap (GNUNET_YES, | 490 | publish_proc = GNUNET_OS_start_process_vap (GNUNET_YES, |
491 | 0, NULL, NULL, | 491 | 0, NULL, NULL, NULL, |
492 | "gnunet-publish", | 492 | "gnunet-publish", |
493 | argv); | 493 | argv); |
494 | if (NULL == publish_proc) | 494 | if (NULL == publish_proc) |
diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c index be7cbbb28..a844ae86b 100755 --- a/src/gns/gnunet-gns-import.c +++ b/src/gns/gnunet-gns-import.c | |||
@@ -129,8 +129,11 @@ run_process_and_wait (int pipe_control, | |||
129 | va_end (apc2); | 129 | va_end (apc2); |
130 | if (arglen > 0) | 130 | if (arglen > 0) |
131 | argp[-1] = '\0'; | 131 | argp[-1] = '\0'; |
132 | p = GNUNET_OS_start_process_va (pipe_control, std_inheritance, pipe_stdin, | 132 | p = GNUNET_OS_start_process_va (pipe_control, std_inheritance, |
133 | pipe_stdout, filename, ap); | 133 | pipe_stdin, |
134 | pipe_stdout, | ||
135 | NULL, | ||
136 | filename, ap); | ||
134 | va_end (ap); | 137 | va_end (ap); |
135 | if (NULL == p) | 138 | if (NULL == p) |
136 | { | 139 | { |
diff --git a/src/gns/test_gns_proxy.c b/src/gns/test_gns_proxy.c index eac9e4449..9e2c29fb4 100644 --- a/src/gns/test_gns_proxy.c +++ b/src/gns/test_gns_proxy.c | |||
@@ -401,6 +401,7 @@ run (void *cls, | |||
401 | GNUNET_OS_INHERIT_STD_ALL, | 401 | GNUNET_OS_INHERIT_STD_ALL, |
402 | NULL, | 402 | NULL, |
403 | NULL, | 403 | NULL, |
404 | NULL, | ||
404 | "gnunet-gns-proxy", | 405 | "gnunet-gns-proxy", |
405 | "gnunet-gns-proxy", | 406 | "gnunet-gns-proxy", |
406 | "-c", tmp_cfgfile, NULL); | 407 | "-c", tmp_cfgfile, NULL); |
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c index 2e1e5acb5..951d1cd8b 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist.c +++ b/src/hostlist/test_gnunet_daemon_hostlist.c | |||
@@ -135,9 +135,11 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
135 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 135 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
136 | p->cfg = GNUNET_CONFIGURATION_create (); | 136 | p->cfg = GNUNET_CONFIGURATION_create (); |
137 | p->arm_proc = | 137 | p->arm_proc = |
138 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 138 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
139 | "gnunet-service-arm", | 139 | NULL, NULL, NULL, |
140 | "-c", cfgname, NULL); | 140 | binary, |
141 | "gnunet-service-arm", | ||
142 | "-c", cfgname, NULL); | ||
141 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 143 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
142 | p->th = | 144 | p->th = |
143 | GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL); | 145 | GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL); |
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c index f581b532a..8a5cdac7a 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c | |||
@@ -385,9 +385,11 @@ setup_learn_peer (struct PeerContext *p, const char *cfgname) | |||
385 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 385 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
386 | p->cfg = GNUNET_CONFIGURATION_create (); | 386 | p->cfg = GNUNET_CONFIGURATION_create (); |
387 | p->arm_proc = | 387 | p->arm_proc = |
388 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 388 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
389 | "gnunet-service-arm", | 389 | NULL, NULL, NULL, |
390 | "-c", cfgname, NULL); | 390 | binary, |
391 | "gnunet-service-arm", | ||
392 | "-c", cfgname, NULL); | ||
391 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 393 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
392 | if (GNUNET_OK == | 394 | if (GNUNET_OK == |
393 | GNUNET_CONFIGURATION_get_value_string (p->cfg, "HOSTLIST", "HOSTLISTFILE", | 395 | GNUNET_CONFIGURATION_get_value_string (p->cfg, "HOSTLIST", "HOSTLISTFILE", |
@@ -420,7 +422,9 @@ setup_adv_peer (struct PeerContext *p, const char *cfgname) | |||
420 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 422 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
421 | p->cfg = GNUNET_CONFIGURATION_create (); | 423 | p->cfg = GNUNET_CONFIGURATION_create (); |
422 | p->arm_proc = | 424 | p->arm_proc = |
423 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 425 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
426 | NULL, NULL, NULL, | ||
427 | binary, | ||
424 | "gnunet-service-arm", | 428 | "gnunet-service-arm", |
425 | "-c", cfgname, NULL); | 429 | "-c", cfgname, NULL); |
426 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 430 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 6b38ffe19..1962bcd45 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c | |||
@@ -135,9 +135,11 @@ setup_peer (struct PeerContext *p, const char *cfgname) | |||
135 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); | 135 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm"); |
136 | p->cfg = GNUNET_CONFIGURATION_create (); | 136 | p->cfg = GNUNET_CONFIGURATION_create (); |
137 | p->arm_proc = | 137 | p->arm_proc = |
138 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 138 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
139 | "gnunet-service-arm", | 139 | NULL, NULL, NULL, |
140 | "-c", cfgname, NULL); | 140 | binary, |
141 | "gnunet-service-arm", | ||
142 | "-c", cfgname, NULL); | ||
141 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); | 143 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); |
142 | p->th = | 144 | p->th = |
143 | GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL); | 145 | GNUNET_TRANSPORT_connect (p->cfg, NULL, p, NULL, ¬ify_connect, NULL); |
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index f815c95cd..56c66fcdb 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -310,6 +310,7 @@ GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | |||
310 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags | 310 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags |
311 | * @param pipe_stdin pipe to use to send input to child process (or NULL) | 311 | * @param pipe_stdin pipe to use to send input to child process (or NULL) |
312 | * @param pipe_stdout pipe to use to get output from child process (or NULL) | 312 | * @param pipe_stdout pipe to use to get output from child process (or NULL) |
313 | * @param pipe_stderr pipe to use to get error output from child process (or NULL) | ||
313 | * @param filename name of the binary | 314 | * @param filename name of the binary |
314 | * @param argv NULL-terminated array of arguments to the process | 315 | * @param argv NULL-terminated array of arguments to the process |
315 | * @return pointer to process structure of the new process, NULL on error | 316 | * @return pointer to process structure of the new process, NULL on error |
@@ -319,6 +320,7 @@ GNUNET_OS_start_process_vap (int pipe_control, | |||
319 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 320 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
320 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 321 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
321 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 322 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
323 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | ||
322 | const char *filename, | 324 | const char *filename, |
323 | char *const argv[]); | 325 | char *const argv[]); |
324 | 326 | ||
@@ -330,6 +332,7 @@ GNUNET_OS_start_process_vap (int pipe_control, | |||
330 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags | 332 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags |
331 | * @param pipe_stdin pipe to use to send input to child process (or NULL) | 333 | * @param pipe_stdin pipe to use to send input to child process (or NULL) |
332 | * @param pipe_stdout pipe to use to get output from child process (or NULL) | 334 | * @param pipe_stdout pipe to use to get output from child process (or NULL) |
335 | * @param pipe_stderr pipe to use to get error output from child process (or NULL) | ||
333 | * @param filename name of the binary | 336 | * @param filename name of the binary |
334 | * @param ... NULL-terminated list of arguments to the process | 337 | * @param ... NULL-terminated list of arguments to the process |
335 | * @return pointer to process structure of the new process, NULL on error | 338 | * @return pointer to process structure of the new process, NULL on error |
@@ -339,6 +342,7 @@ GNUNET_OS_start_process (int pipe_control, | |||
339 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 342 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
340 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 343 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
341 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 344 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
345 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | ||
342 | const char *filename, ...); | 346 | const char *filename, ...); |
343 | 347 | ||
344 | 348 | ||
@@ -349,6 +353,7 @@ GNUNET_OS_start_process (int pipe_control, | |||
349 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags | 353 | * @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags |
350 | * @param pipe_stdin pipe to use to send input to child process (or NULL) | 354 | * @param pipe_stdin pipe to use to send input to child process (or NULL) |
351 | * @param pipe_stdout pipe to use to get output from child process (or NULL) | 355 | * @param pipe_stdout pipe to use to get output from child process (or NULL) |
356 | * @param pipe_stderr pipe to use to get error output from child process (or NULL) | ||
352 | * @param filename name of the binary | 357 | * @param filename name of the binary |
353 | * @param va NULL-terminated list of arguments to the process | 358 | * @param va NULL-terminated list of arguments to the process |
354 | * @return pointer to process structure of the new process, NULL on error | 359 | * @return pointer to process structure of the new process, NULL on error |
@@ -358,6 +363,7 @@ GNUNET_OS_start_process_va (int pipe_control, | |||
358 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 363 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
359 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 364 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
360 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 365 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
366 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | ||
361 | const char *filename, va_list va); | 367 | const char *filename, va_list va); |
362 | 368 | ||
363 | /** | 369 | /** |
diff --git a/src/nat/nat.c b/src/nat/nat.c index ae40a2cd1..bb51f43b2 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c | |||
@@ -907,7 +907,7 @@ start_gnunet_nat_server (struct GNUNET_NAT_Handle *h) | |||
907 | /* Start the server process */ | 907 | /* Start the server process */ |
908 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-server"); | 908 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-server"); |
909 | h->server_proc = | 909 | h->server_proc = |
910 | GNUNET_OS_start_process (GNUNET_NO, 0, NULL, h->server_stdout, | 910 | GNUNET_OS_start_process (GNUNET_NO, 0, NULL, h->server_stdout, NULL, |
911 | binary, | 911 | binary, |
912 | "gnunet-helper-nat-server", | 912 | "gnunet-helper-nat-server", |
913 | h->internal_address, NULL); | 913 | h->internal_address, NULL); |
@@ -1445,7 +1445,7 @@ GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | |||
1445 | (unsigned int) h->adv_port); | 1445 | (unsigned int) h->adv_port); |
1446 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-client"); | 1446 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-helper-nat-client"); |
1447 | proc = | 1447 | proc = |
1448 | GNUNET_OS_start_process (GNUNET_NO, 0, NULL, NULL, | 1448 | GNUNET_OS_start_process (GNUNET_NO, 0, NULL, NULL, NULL, |
1449 | binary, | 1449 | binary, |
1450 | "gnunet-helper-nat-client", | 1450 | "gnunet-helper-nat-client", |
1451 | h->internal_address, | 1451 | h->internal_address, |
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c index a5ae4ad08..ce4bc6778 100644 --- a/src/nat/nat_mini.c +++ b/src/nat/nat_mini.c | |||
@@ -213,8 +213,8 @@ GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, | |||
213 | return eh; | 213 | return eh; |
214 | } | 214 | } |
215 | eh->eip = | 215 | eh->eip = |
216 | GNUNET_OS_start_process (GNUNET_NO, 0, NULL, eh->opipe, | 216 | GNUNET_OS_start_process (GNUNET_NO, 0, NULL, eh->opipe, NULL, |
217 | "external-ip", "external-ip", | 217 | "external-ip", "external-ip", |
218 | NULL); | 218 | NULL); |
219 | if (NULL == eh->eip) | 219 | if (NULL == eh->eip) |
220 | { | 220 | { |
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c index 64425ab47..f66773a65 100644 --- a/src/nat/test_nat_test.c +++ b/src/nat/test_nat_test.c | |||
@@ -107,7 +107,8 @@ main (int argc, char *const argv[]) | |||
107 | 107 | ||
108 | gns = GNUNET_OS_start_process (GNUNET_YES, | 108 | gns = GNUNET_OS_start_process (GNUNET_YES, |
109 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 109 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
110 | NULL, NULL, "gnunet-nat-server", | 110 | NULL, NULL, NULL, |
111 | "gnunet-nat-server", | ||
111 | "gnunet-nat-server", | 112 | "gnunet-nat-server", |
112 | "-c", "test_nat_test_data.conf", | 113 | "-c", "test_nat_test_data.conf", |
113 | "12345", NULL); | 114 | "12345", NULL); |
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c index aa9088f35..77f6bee80 100644 --- a/src/statistics/test_statistics_api.c +++ b/src/statistics/test_statistics_api.c | |||
@@ -146,7 +146,8 @@ main (int argc, char *argv_ign[]) | |||
146 | NULL); | 146 | NULL); |
147 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); | 147 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); |
148 | proc = | 148 | proc = |
149 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, | 149 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
150 | NULL, NULL, NULL, | ||
150 | binary, | 151 | binary, |
151 | "gnunet-service-statistics", | 152 | "gnunet-service-statistics", |
152 | "-c", "test_statistics_api_data.conf", NULL); | 153 | "-c", "test_statistics_api_data.conf", NULL); |
@@ -169,7 +170,8 @@ main (int argc, char *argv_ign[]) | |||
169 | ok = 1; | 170 | ok = 1; |
170 | /* restart to check persistence! */ | 171 | /* restart to check persistence! */ |
171 | proc = | 172 | proc = |
172 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, | 173 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
174 | NULL, NULL, NULL, | ||
173 | binary, | 175 | binary, |
174 | "gnunet-service-statistics", | 176 | "gnunet-service-statistics", |
175 | "-c", "test_statistics_api_data.conf", NULL); | 177 | "-c", "test_statistics_api_data.conf", NULL); |
diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c index 7a7b44c1f..13520d702 100644 --- a/src/statistics/test_statistics_api_loop.c +++ b/src/statistics/test_statistics_api_loop.c | |||
@@ -94,7 +94,7 @@ main (int argc, char *argv_ign[]) | |||
94 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); | 94 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); |
95 | proc = | 95 | proc = |
96 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 96 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
97 | NULL, NULL, | 97 | NULL, NULL, NULL, |
98 | binary, | 98 | binary, |
99 | "gnunet-service-statistics", | 99 | "gnunet-service-statistics", |
100 | "-c", "test_statistics_api_data.conf", NULL); | 100 | "-c", "test_statistics_api_data.conf", NULL); |
diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c index 78bc425c5..05806ac4b 100644 --- a/src/statistics/test_statistics_api_watch.c +++ b/src/statistics/test_statistics_api_watch.c | |||
@@ -122,7 +122,8 @@ main (int argc, char *argv_ign[]) | |||
122 | 122 | ||
123 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); | 123 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); |
124 | proc = | 124 | proc = |
125 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, | 125 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
126 | NULL, NULL, NULL, | ||
126 | binary, | 127 | binary, |
127 | "gnunet-service-statistics", | 128 | "gnunet-service-statistics", |
128 | "-c", "test_statistics_api_data.conf", NULL); | 129 | "-c", "test_statistics_api_data.conf", NULL); |
diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c index c42c44428..462c91ebe 100644 --- a/src/statistics/test_statistics_api_watch_zero_value.c +++ b/src/statistics/test_statistics_api_watch_zero_value.c | |||
@@ -157,7 +157,8 @@ main (int argc, char *argv_ign[]) | |||
157 | 157 | ||
158 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); | 158 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics"); |
159 | proc = | 159 | proc = |
160 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, | 160 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
161 | NULL, NULL, NULL, | ||
161 | binary, | 162 | binary, |
162 | "gnunet-service-statistics", | 163 | "gnunet-service-statistics", |
163 | "-c", "test_statistics_api_data.conf", NULL); | 164 | "-c", "test_statistics_api_data.conf", NULL); |
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index e8c70a354..6937d7262 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c | |||
@@ -461,8 +461,9 @@ tokenizer_cb (void *cls, void *client, | |||
461 | } | 461 | } |
462 | testbed = | 462 | testbed = |
463 | GNUNET_OS_start_process (PIPE_CONTROL, | 463 | GNUNET_OS_start_process (PIPE_CONTROL, |
464 | GNUNET_OS_INHERIT_STD_ERR /*verbose? */ , NULL, | 464 | GNUNET_OS_INHERIT_STD_ERR /*verbose? */ , |
465 | NULL, binary, "gnunet-service-testbed", "-c", | 465 | NULL, NULL, NULL, |
466 | binary, "gnunet-service-testbed", "-c", | ||
466 | config, NULL); | 467 | config, NULL); |
467 | GNUNET_free (binary); | 468 | GNUNET_free (binary); |
468 | GNUNET_free (config); | 469 | GNUNET_free (config); |
diff --git a/src/testbed/gnunet_mpi_test.c b/src/testbed/gnunet_mpi_test.c index fded9e2c2..7fe7a75d7 100644 --- a/src/testbed/gnunet_mpi_test.c +++ b/src/testbed/gnunet_mpi_test.c | |||
@@ -70,7 +70,7 @@ main (int argc, char *argv[]) | |||
70 | argv2[cnt - 1] = argv[cnt]; | 70 | argv2[cnt - 1] = argv[cnt]; |
71 | proc = | 71 | proc = |
72 | GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL, | 72 | GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL, |
73 | NULL, argv2[0], argv2); | 73 | NULL, NULL, argv2[0], argv2); |
74 | if (NULL == proc) | 74 | if (NULL == proc) |
75 | { | 75 | { |
76 | printf ("Cannot exec\n"); | 76 | printf ("Cannot exec\n"); |
diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c index d3a78d3d4..41d805471 100644 --- a/src/testbed/gnunet_testbed_mpi_spawn.c +++ b/src/testbed/gnunet_testbed_mpi_spawn.c | |||
@@ -246,7 +246,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
246 | /* Spawn the new process here */ | 246 | /* Spawn the new process here */ |
247 | LOG (GNUNET_ERROR_TYPE_INFO, _("Spawning process `%s'\n"), argv2[0]); | 247 | LOG (GNUNET_ERROR_TYPE_INFO, _("Spawning process `%s'\n"), argv2[0]); |
248 | child = GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL, | 248 | child = GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ALL, NULL, |
249 | NULL, | 249 | NULL, NULL, |
250 | argv2[0], argv2); | 250 | argv2[0], argv2); |
251 | if (NULL == child) | 251 | if (NULL == child) |
252 | { | 252 | { |
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index 5a5b00e5a..ed3379d88 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -1349,7 +1349,7 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | |||
1349 | free_argv (rsh_args); | 1349 | free_argv (rsh_args); |
1350 | h->auxp = | 1350 | h->auxp = |
1351 | GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, NULL, | 1351 | GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, NULL, |
1352 | NULL, h->helper_argv[0], h->helper_argv); | 1352 | NULL, NULL, h->helper_argv[0], h->helper_argv); |
1353 | if (NULL == h->auxp) | 1353 | if (NULL == h->auxp) |
1354 | { | 1354 | { |
1355 | GNUNET_break (0); /* Cannot exec SSH? */ | 1355 | GNUNET_break (0); /* Cannot exec SSH? */ |
diff --git a/src/testing/testing.c b/src/testing/testing.c index 5cb823575..51876bf1f 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -491,7 +491,7 @@ start_shared_service_instance (struct SharedServiceInstance *i) | |||
491 | GNUNET_free (binary); | 491 | GNUNET_free (binary); |
492 | i->proc = GNUNET_OS_start_process (PIPE_CONTROL, | 492 | i->proc = GNUNET_OS_start_process (PIPE_CONTROL, |
493 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 493 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
494 | NULL, NULL, | 494 | NULL, NULL, NULL, |
495 | libexec_binary, | 495 | libexec_binary, |
496 | libexec_binary, | 496 | libexec_binary, |
497 | "-c", | 497 | "-c", |
diff --git a/src/transport/gnunet-transport-certificate-creation.c b/src/transport/gnunet-transport-certificate-creation.c index fbf809426..e86696254 100644 --- a/src/transport/gnunet-transport-certificate-creation.c +++ b/src/transport/gnunet-transport-certificate-creation.c | |||
@@ -94,7 +94,9 @@ main (int argc, char **argv) | |||
94 | /* Create RSA Private Key */ | 94 | /* Create RSA Private Key */ |
95 | /* openssl genrsa -out $1 1024 2> /dev/null */ | 95 | /* openssl genrsa -out $1 1024 2> /dev/null */ |
96 | openssl = | 96 | openssl = |
97 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "openssl", "openssl", "genrsa", | 97 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
98 | NULL, NULL, NULL, | ||
99 | "openssl", "openssl", "genrsa", | ||
98 | "-out", argv[1], "1024", NULL); | 100 | "-out", argv[1], "1024", NULL); |
99 | if (NULL == openssl) | 101 | if (NULL == openssl) |
100 | { | 102 | { |
@@ -108,7 +110,9 @@ main (int argc, char **argv) | |||
108 | /* Create a self-signed certificate in batch mode using rsa key */ | 110 | /* Create a self-signed certificate in batch mode using rsa key */ |
109 | /* openssl req -batch -days 365 -out $2 -new -x509 -key $1 2> /dev/null */ | 111 | /* openssl req -batch -days 365 -out $2 -new -x509 -key $1 2> /dev/null */ |
110 | openssl = | 112 | openssl = |
111 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, "openssl", "openssl", "req", | 113 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
114 | NULL, NULL, NULL, | ||
115 | "openssl", "openssl", "req", | ||
112 | "-batch", "-days", "365", "-out", argv[2], | 116 | "-batch", "-days", "365", "-out", argv[2], |
113 | "-new", "-x509", "-key", argv[1], NULL); | 117 | "-new", "-x509", "-key", argv[1], NULL); |
114 | if (NULL == openssl) | 118 | if (NULL == openssl) |
diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 49c31663b..f9d3ad44a 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c | |||
@@ -665,8 +665,10 @@ do_test_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
665 | { | 665 | { |
666 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); | 666 | binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); |
667 | resolver = GNUNET_OS_start_process (GNUNET_YES, | 667 | resolver = GNUNET_OS_start_process (GNUNET_YES, |
668 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, binary, | 668 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
669 | "gnunet-service-resolver", NULL ); | 669 | NULL, NULL, NULL, |
670 | binary, | ||
671 | "gnunet-service-resolver", NULL ); | ||
670 | GNUNET_free(binary); | 672 | GNUNET_free(binary); |
671 | } | 673 | } |
672 | resolver_users++; | 674 | resolver_users++; |
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c index 53ee27005..d1a36bc13 100644 --- a/src/transport/plugin_transport_http_server.c +++ b/src/transport/plugin_transport_http_server.c | |||
@@ -1946,7 +1946,8 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin) | |||
1946 | "No usable TLS certificate found, creating certificate\n"); | 1946 | "No usable TLS certificate found, creating certificate\n"); |
1947 | errno = 0; | 1947 | errno = 0; |
1948 | cert_creation = | 1948 | cert_creation = |
1949 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, NULL, | 1949 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
1950 | NULL, NULL, NULL, | ||
1950 | "gnunet-transport-certificate-creation", | 1951 | "gnunet-transport-certificate-creation", |
1951 | "gnunet-transport-certificate-creation", | 1952 | "gnunet-transport-certificate-creation", |
1952 | key_file, cert_file, NULL); | 1953 | key_file, cert_file, NULL); |
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c index 279c5a42e..545b78981 100644 --- a/src/util/gnunet-uri.c +++ b/src/util/gnunet-uri.c | |||
@@ -113,7 +113,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
113 | GNUNET_DISK_PIPE_END_READ), | 113 | GNUNET_DISK_PIPE_END_READ), |
114 | &maint_child_death, NULL); | 114 | &maint_child_death, NULL); |
115 | p = GNUNET_OS_start_process (GNUNET_NO, 0, | 115 | p = GNUNET_OS_start_process (GNUNET_NO, 0, |
116 | NULL, NULL, | 116 | NULL, NULL, NULL, |
117 | program, | 117 | program, |
118 | program, | 118 | program, |
119 | args[0], | 119 | args[0], |
diff --git a/src/util/helper.c b/src/util/helper.c index 404dad4fa..105ccf057 100644 --- a/src/util/helper.c +++ b/src/util/helper.c | |||
@@ -426,7 +426,7 @@ start_helper (struct GNUNET_HELPER_Handle *h) | |||
426 | GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE); | 426 | GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE); |
427 | h->helper_proc = | 427 | h->helper_proc = |
428 | GNUNET_OS_start_process_vap (h->with_control_pipe, GNUNET_OS_INHERIT_STD_ERR, | 428 | GNUNET_OS_start_process_vap (h->with_control_pipe, GNUNET_OS_INHERIT_STD_ERR, |
429 | h->helper_in, h->helper_out, | 429 | h->helper_in, h->helper_out, NULL, |
430 | h->binary_name, | 430 | h->binary_name, |
431 | h->binary_argv); | 431 | h->binary_argv); |
432 | if (NULL == h->helper_proc) | 432 | if (NULL == h->helper_proc) |
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index 23eb1d168..d0c512363 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -503,6 +503,7 @@ start_process (int pipe_control, | |||
503 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 503 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
504 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 504 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
505 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 505 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
506 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | ||
506 | const SOCKTYPE *lsocks, | 507 | const SOCKTYPE *lsocks, |
507 | const char *filename, | 508 | const char *filename, |
508 | char *const argv[]) | 509 | char *const argv[]) |
@@ -523,6 +524,8 @@ start_process (int pipe_control, | |||
523 | unsigned int ls; | 524 | unsigned int ls; |
524 | int fd_stdout_write; | 525 | int fd_stdout_write; |
525 | int fd_stdout_read; | 526 | int fd_stdout_read; |
527 | int fd_stderr_write; | ||
528 | int fd_stderr_read; | ||
526 | int fd_stdin_read; | 529 | int fd_stdin_read; |
527 | int fd_stdin_write; | 530 | int fd_stdin_write; |
528 | 531 | ||
@@ -583,6 +586,19 @@ start_process (int pipe_control, | |||
583 | (pipe_stdin, GNUNET_DISK_PIPE_END_WRITE), | 586 | (pipe_stdin, GNUNET_DISK_PIPE_END_WRITE), |
584 | &fd_stdin_write, sizeof (int))); | 587 | &fd_stdin_write, sizeof (int))); |
585 | } | 588 | } |
589 | if (NULL != pipe_stderr) | ||
590 | { | ||
591 | GNUNET_assert (GNUNET_OK == | ||
592 | GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle | ||
593 | (pipe_stderr, | ||
594 | GNUNET_DISK_PIPE_END_READ), | ||
595 | &fd_stderr_read, sizeof (int))); | ||
596 | GNUNET_assert (GNUNET_OK == | ||
597 | GNUNET_DISK_internal_file_handle_ (GNUNET_DISK_pipe_handle | ||
598 | (pipe_stderr, | ||
599 | GNUNET_DISK_PIPE_END_WRITE), | ||
600 | &fd_stderr_write, sizeof (int))); | ||
601 | } | ||
586 | lscp = NULL; | 602 | lscp = NULL; |
587 | ls = 0; | 603 | ls = 0; |
588 | if (NULL != lsocks) | 604 | if (NULL != lsocks) |
@@ -659,7 +675,14 @@ start_process (int pipe_control, | |||
659 | GNUNET_break (0 == close (1)); | 675 | GNUNET_break (0 == close (1)); |
660 | open_dev_null (1, O_WRONLY); | 676 | open_dev_null (1, O_WRONLY); |
661 | } | 677 | } |
662 | if (0 == (std_inheritance & GNUNET_OS_INHERIT_STD_ERR)) | 678 | if (NULL != pipe_stderr) |
679 | { | ||
680 | GNUNET_break (0 == close (fd_stderr_read)); | ||
681 | if (-1 == dup2 (fd_stderr_write, 2)) | ||
682 | LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR, "dup2"); | ||
683 | GNUNET_break (0 == close (fd_stderr_write)); | ||
684 | } | ||
685 | else if (0 == (std_inheritance & GNUNET_OS_INHERIT_STD_ERR)) | ||
663 | { | 686 | { |
664 | GNUNET_break (0 == close (2)); | 687 | GNUNET_break (0 == close (2)); |
665 | open_dev_null (2, O_WRONLY); | 688 | open_dev_null (2, O_WRONLY); |
@@ -1220,6 +1243,7 @@ GNUNET_OS_start_process_vap (int pipe_control, | |||
1220 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 1243 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
1221 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 1244 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
1222 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 1245 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
1246 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | ||
1223 | const char *filename, | 1247 | const char *filename, |
1224 | char *const argv[]) | 1248 | char *const argv[]) |
1225 | { | 1249 | { |
@@ -1227,6 +1251,7 @@ GNUNET_OS_start_process_vap (int pipe_control, | |||
1227 | std_inheritance, | 1251 | std_inheritance, |
1228 | pipe_stdin, | 1252 | pipe_stdin, |
1229 | pipe_stdout, | 1253 | pipe_stdout, |
1254 | pipe_stderr, | ||
1230 | NULL, | 1255 | NULL, |
1231 | filename, | 1256 | filename, |
1232 | argv); | 1257 | argv); |
@@ -1249,6 +1274,7 @@ GNUNET_OS_start_process_va (int pipe_control, | |||
1249 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 1274 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
1250 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 1275 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
1251 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 1276 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
1277 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | ||
1252 | const char *filename, va_list va) | 1278 | const char *filename, va_list va) |
1253 | { | 1279 | { |
1254 | struct GNUNET_OS_Process *ret; | 1280 | struct GNUNET_OS_Process *ret; |
@@ -1271,6 +1297,7 @@ GNUNET_OS_start_process_va (int pipe_control, | |||
1271 | std_inheritance, | 1297 | std_inheritance, |
1272 | pipe_stdin, | 1298 | pipe_stdin, |
1273 | pipe_stdout, | 1299 | pipe_stdout, |
1300 | pipe_stderr, | ||
1274 | filename, | 1301 | filename, |
1275 | argv); | 1302 | argv); |
1276 | GNUNET_free (argv); | 1303 | GNUNET_free (argv); |
@@ -1294,14 +1321,20 @@ GNUNET_OS_start_process (int pipe_control, | |||
1294 | enum GNUNET_OS_InheritStdioFlags std_inheritance, | 1321 | enum GNUNET_OS_InheritStdioFlags std_inheritance, |
1295 | struct GNUNET_DISK_PipeHandle *pipe_stdin, | 1322 | struct GNUNET_DISK_PipeHandle *pipe_stdin, |
1296 | struct GNUNET_DISK_PipeHandle *pipe_stdout, | 1323 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
1324 | struct GNUNET_DISK_PipeHandle *pipe_stderr, | ||
1297 | const char *filename, ...) | 1325 | const char *filename, ...) |
1298 | { | 1326 | { |
1299 | struct GNUNET_OS_Process *ret; | 1327 | struct GNUNET_OS_Process *ret; |
1300 | va_list ap; | 1328 | va_list ap; |
1301 | 1329 | ||
1302 | va_start (ap, filename); | 1330 | va_start (ap, filename); |
1303 | ret = GNUNET_OS_start_process_va (pipe_control, std_inheritance, pipe_stdin, | 1331 | ret = GNUNET_OS_start_process_va (pipe_control, |
1304 | pipe_stdout, filename, ap); | 1332 | std_inheritance, |
1333 | pipe_stdin, | ||
1334 | pipe_stdout, | ||
1335 | pipe_stderr, | ||
1336 | filename, | ||
1337 | ap); | ||
1305 | va_end (ap); | 1338 | va_end (ap); |
1306 | return ret; | 1339 | return ret; |
1307 | } | 1340 | } |
@@ -1332,6 +1365,7 @@ GNUNET_OS_start_process_v (int pipe_control, | |||
1332 | std_inheritance, | 1365 | std_inheritance, |
1333 | NULL, | 1366 | NULL, |
1334 | NULL, | 1367 | NULL, |
1368 | NULL, | ||
1335 | lsocks, | 1369 | lsocks, |
1336 | filename, | 1370 | filename, |
1337 | argv); | 1371 | argv); |
@@ -1776,7 +1810,7 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, | |||
1776 | return NULL; | 1810 | return NULL; |
1777 | va_start (ap, binary); | 1811 | va_start (ap, binary); |
1778 | /* redirect stdout, don't inherit stderr/stdin */ | 1812 | /* redirect stdout, don't inherit stderr/stdin */ |
1779 | eip = GNUNET_OS_start_process_va (GNUNET_NO, 0, NULL, opipe, binary, ap); | 1813 | eip = GNUNET_OS_start_process_va (GNUNET_NO, 0, NULL, opipe, NULL, binary, ap); |
1780 | va_end (ap); | 1814 | va_end (ap); |
1781 | if (NULL == eip) | 1815 | if (NULL == eip) |
1782 | { | 1816 | { |
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index 3361ca1b1..0fe8614d0 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c | |||
@@ -391,7 +391,8 @@ runone () | |||
391 | break; | 391 | break; |
392 | } | 392 | } |
393 | 393 | ||
394 | proc = GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, NULL, pipe_stdout, | 394 | proc = GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
395 | NULL, pipe_stdout, NULL, | ||
395 | #if MINGW | 396 | #if MINGW |
396 | "test_common_logging_dummy", | 397 | "test_common_logging_dummy", |
397 | #else | 398 | #else |
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index 90d8ae101..e76ec5bcf 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c | |||
@@ -135,7 +135,8 @@ run_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
135 | 135 | ||
136 | proc = | 136 | proc = |
137 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, | 137 | GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, |
138 | hello_pipe_stdin, hello_pipe_stdout, fn, | 138 | hello_pipe_stdin, hello_pipe_stdout, NULL, |
139 | fn, | ||
139 | "test_gnunet_echo_hello", "-", NULL); | 140 | "test_gnunet_echo_hello", "-", NULL); |
140 | GNUNET_free (fn); | 141 | GNUNET_free (fn); |
141 | 142 | ||
@@ -203,7 +204,9 @@ check_kill () | |||
203 | } | 204 | } |
204 | fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); | 205 | fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); |
205 | proc = | 206 | proc = |
206 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, hello_pipe_stdin, hello_pipe_stdout, fn, | 207 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, |
208 | hello_pipe_stdin, hello_pipe_stdout, NULL, | ||
209 | fn, | ||
207 | "gnunet-service-resolver", "-", NULL); | 210 | "gnunet-service-resolver", "-", NULL); |
208 | sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */ | 211 | sleep (1); /* give process time to start, so we actually use the pipe-kill mechanism! */ |
209 | GNUNET_free (fn); | 212 | GNUNET_free (fn); |
@@ -234,7 +237,9 @@ check_instant_kill () | |||
234 | } | 237 | } |
235 | fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); | 238 | fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); |
236 | proc = | 239 | proc = |
237 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, hello_pipe_stdin, hello_pipe_stdout, fn, | 240 | GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR, |
241 | hello_pipe_stdin, hello_pipe_stdout, NULL, | ||
242 | fn, | ||
238 | "gnunet-service-resolver", "-", NULL); | 243 | "gnunet-service-resolver", "-", NULL); |
239 | if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) | 244 | if (0 != GNUNET_OS_process_kill (proc, GNUNET_TERM_SIG)) |
240 | { | 245 | { |
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index c94990415..acc3ae6ae 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c | |||
@@ -367,7 +367,8 @@ main (int argc, char *argv[]) | |||
367 | fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); | 367 | fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver"); |
368 | proc = GNUNET_OS_start_process (GNUNET_YES, | 368 | proc = GNUNET_OS_start_process (GNUNET_YES, |
369 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, | 369 | GNUNET_OS_INHERIT_STD_OUT_AND_ERR, |
370 | NULL, NULL, fn, | 370 | NULL, NULL, NULL, |
371 | fn, | ||
371 | "gnunet-service-resolver", | 372 | "gnunet-service-resolver", |
372 | "-c", "test_resolver_api_data.conf", NULL); | 373 | "-c", "test_resolver_api_data.conf", NULL); |
373 | GNUNET_assert (NULL != proc); | 374 | GNUNET_assert (NULL != proc); |