summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arm/arm_api.c12
-rw-r--r--src/arm/gnunet-service-arm.c25
-rw-r--r--src/core/test_core_api.c4
-rw-r--r--src/core/test_core_api_reliability.c4
-rw-r--r--src/core/test_core_api_start_only.c4
-rw-r--r--src/core/test_core_quota_compliance.c4
-rw-r--r--src/fs/gnunet-auto-share.c3
-rw-r--r--src/gns/gnunet-gns-import.c30
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist.c4
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c7
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_reconnect.c4
-rw-r--r--src/include/gnunet_os_lib.h27
-rw-r--r--src/nat/gnunet-service-nat_helper.c6
-rw-r--r--src/nat/gnunet-service-nat_mini.c3
-rw-r--r--src/nat/test_nat_test.c4
-rw-r--r--src/nat/test_stun.c4
-rw-r--r--src/pq/pq_connect.c3
-rw-r--r--src/statistics/test_statistics_api.c8
-rw-r--r--src/statistics/test_statistics_api_loop.c3
-rw-r--r--src/statistics/test_statistics_api_watch.c3
-rw-r--r--src/statistics/test_statistics_api_watch_zero_value.c3
-rw-r--r--src/testbed/gnunet-helper-testbed.c9
-rw-r--r--src/testbed/testbed_api_hosts.c3
-rw-r--r--src/testing/testing.c12
-rw-r--r--src/transport/plugin_transport_http_server.c2
-rw-r--r--src/transport/transport-testing2.c12
-rw-r--r--src/util/gnunet-qr.c3
-rw-r--r--src/util/gnunet-uri.c3
-rw-r--r--src/util/helper.c5
-rw-r--r--src/util/os_priority.c50
-rw-r--r--src/util/test_common_logging_runtime_loglevels.c2
-rw-r--r--src/util/test_os_start_process.c8
-rw-r--r--src/util/test_resolver_api.c4
33 files changed, 123 insertions, 155 deletions
diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c
index cd5f44565..dea7a70be 100644
--- a/src/arm/arm_api.c
+++ b/src/arm/arm_api.c
@@ -729,8 +729,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h,
/* Means we are ONLY running locally */
/* we're clearly running a test, don't daemonize */
if (NULL == config)
- proc = GNUNET_OS_start_process_s (GNUNET_NO,
- std_inheritance,
+ proc = GNUNET_OS_start_process_s (std_inheritance,
lsocks,
loprefix,
quotedbinary,
@@ -738,8 +737,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h,
lopostfix,
NULL);
else
- proc = GNUNET_OS_start_process_s (GNUNET_NO,
- std_inheritance,
+ proc = GNUNET_OS_start_process_s (std_inheritance,
lsocks,
loprefix,
quotedbinary,
@@ -752,8 +750,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h,
else
{
if (NULL == config)
- proc = GNUNET_OS_start_process_s (GNUNET_NO,
- std_inheritance,
+ proc = GNUNET_OS_start_process_s (std_inheritance,
lsocks,
loprefix,
quotedbinary,
@@ -761,8 +758,7 @@ start_arm_service (struct GNUNET_ARM_Handle *h,
lopostfix,
NULL);
else
- proc = GNUNET_OS_start_process_s (GNUNET_NO,
- std_inheritance,
+ proc = GNUNET_OS_start_process_s (std_inheritance,
lsocks,
loprefix,
quotedbinary,
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index 5efd8b72b..00b6e7196 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -858,8 +858,9 @@ start_process (struct ServiceList *sl,
* of ''-quoted strings, escaping should be considered. */
if (NULL != options)
options = GNUNET_CONFIGURATION_expand_dollar (cfg, options);
- sl->proc = GNUNET_OS_start_process_s (sl->pipe_control,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
+ ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL
+ : GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
lsocks,
loprefix,
quotedbinary,
@@ -880,8 +881,9 @@ start_process (struct ServiceList *sl,
if (GNUNET_YES == use_debug)
{
if (NULL == sl->config)
- sl->proc = GNUNET_OS_start_process_s (sl->pipe_control,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
+ ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL
+ : GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
lsocks,
loprefix,
quotedbinary,
@@ -890,8 +892,9 @@ start_process (struct ServiceList *sl,
options,
NULL);
else
- sl->proc = GNUNET_OS_start_process_s (sl->pipe_control,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
+ ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL
+ : GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
lsocks,
loprefix,
quotedbinary,
@@ -905,16 +908,18 @@ start_process (struct ServiceList *sl,
else
{
if (NULL == sl->config)
- sl->proc = GNUNET_OS_start_process_s (sl->pipe_control,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
+ ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL
+ : GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
lsocks,
loprefix,
quotedbinary,
options,
NULL);
else
- sl->proc = GNUNET_OS_start_process_s (sl->pipe_control,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ sl->proc = GNUNET_OS_start_process_s (sl->pipe_control
+ ? GNUNET_OS_INHERIT_STD_OUT_AND_ERR | GNUNET_OS_USE_PIPE_CONTROL
+ : GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
lsocks,
loprefix,
quotedbinary,
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index dda60215d..064964292 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -251,8 +251,8 @@ setup_peer (struct PeerContext *p, const char *cfgname)
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
- p->arm_proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ p->arm_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL,
NULL,
NULL,
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index 136539ed3..debf808ca 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -419,8 +419,8 @@ setup_peer (struct PeerContext *p,
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc
- = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-arm",
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index 3cbe50d72..007131134 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -118,8 +118,8 @@ setup_peer (struct PeerContext *p,
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-arm",
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index 67f8bb224..cf2da3d97 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -570,8 +570,8 @@ setup_peer (struct PeerContext *p,
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-arm",
diff --git a/src/fs/gnunet-auto-share.c b/src/fs/gnunet-auto-share.c
index ee4a719e0..41dfe781a 100644
--- a/src/fs/gnunet-auto-share.c
+++ b/src/fs/gnunet-auto-share.c
@@ -478,8 +478,7 @@ work (void *cls)
argv[argc] = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_INFO, _ ("Publishing `%s'\n"), wi->filename);
GNUNET_assert (NULL == publish_proc);
- publish_proc = GNUNET_OS_start_process_vap (GNUNET_YES,
- 0,
+ publish_proc = GNUNET_OS_start_process_vap (GNUNET_OS_USE_PIPE_CONTROL,
NULL,
NULL,
NULL,
diff --git a/src/gns/gnunet-gns-import.c b/src/gns/gnunet-gns-import.c
index 3c95e782d..78db28cab 100644
--- a/src/gns/gnunet-gns-import.c
+++ b/src/gns/gnunet-gns-import.c
@@ -87,8 +87,7 @@ static int ret;
static int
-run_process_and_wait (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+run_process_and_wait (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
enum GNUNET_OS_ProcessStatusType *st,
@@ -120,7 +119,7 @@ run_process_and_wait (int pipe_control,
va_end (apc2);
if (arglen > 0)
argp[-1] = '\0';
- p = GNUNET_OS_start_process_va (pipe_control, std_inheritance,
+ p = GNUNET_OS_start_process_va (std_inheritance,
pipe_stdin,
pipe_stdout,
NULL,
@@ -222,7 +221,7 @@ zone_iteration_error (void *cls)
if (! found_private_rec)
{
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-namestore",
"gnunet-namestore", "-z", "master-zone",
@@ -236,7 +235,7 @@ zone_iteration_error (void *cls)
}
if (! found_pin_rec)
{
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-namestore",
"gnunet-namestore", "-z", "master-zone",
@@ -385,7 +384,8 @@ run (void *cls, char *const *args, const char *cfgfile,
cfg = c;
- if (0 != run_process_and_wait (GNUNET_NO, 0, NULL, NULL, &st, &code,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_NONE,
+ NULL, NULL, &st, &code,
"gnunet-arm",
"gnunet-arm", "-I", NULL))
{
@@ -395,60 +395,60 @@ run (void *cls, char *const *args, const char *cfgfile,
return;
}
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-C", "master-zone", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-C", "private-zone", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-C", "sks-zone", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-e", "master-zone", "-s",
"gns-master", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-e", "master-zone", "-s",
"namestore", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-e", "master-zone", "-s",
"gns-proxy", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-e", "master-zone", "-s",
"gns-intercept", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-e", "private-zone", "-s",
"gns-private", NULL))
return;
- if (0 != run_process_and_wait (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ if (0 != run_process_and_wait (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, &st, &code,
"gnunet-identity",
"gnunet-identity", "-e", "sks-zone", "-s",
diff --git a/src/hostlist/test_gnunet_daemon_hostlist.c b/src/hostlist/test_gnunet_daemon_hostlist.c
index d10924eac..063db2f99 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist.c
@@ -136,8 +136,8 @@ setup_peer (struct PeerContext *p, const char *cfgname)
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
- p->arm_proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ p->arm_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL,
NULL,
NULL,
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index a50e7acc2..a0656f770 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -412,7 +412,8 @@ setup_learn_peer (struct PeerContext *p,
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-arm",
@@ -459,8 +460,8 @@ setup_adv_peer (struct PeerContext *p,
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
p->arm_proc =
- GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-arm",
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
index 657b85fd8..321f96f3d 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c
@@ -105,8 +105,8 @@ setup_peer (struct PeerContext *p, const char *cfgname)
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-arm");
p->cfg = GNUNET_CONFIGURATION_create ();
- p->arm_proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ p->arm_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL,
NULL,
NULL,
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 12aeec7f0..749f766d2 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -100,7 +100,12 @@ enum GNUNET_OS_InheritStdioFlags
* Use this option to have all of the standard streams
* (stdin, stdout and stderror) be inherited.
*/
- GNUNET_OS_INHERIT_STD_ALL = 7
+ GNUNET_OS_INHERIT_STD_ALL = 7,
+
+ /**
+ * Should a pipe be used to send signals to the child?
+ */
+ GNUNET_OS_USE_PIPE_CONTROL = 8
};
@@ -455,7 +460,6 @@ GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param pipe_stdin pipe to use to send input to child process (or NULL)
* @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -465,8 +469,7 @@ GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_vap (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -477,7 +480,6 @@ GNUNET_OS_start_process_vap (int pipe_control,
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param pipe_stdin pipe to use to send input to child process (or NULL)
* @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -487,8 +489,7 @@ GNUNET_OS_start_process_vap (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -498,7 +499,6 @@ GNUNET_OS_start_process (int pipe_control,
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param pipe_stdin pipe to use to send input to child process (or NULL)
* @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -508,8 +508,7 @@ GNUNET_OS_start_process (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_va (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -518,7 +517,6 @@ GNUNET_OS_start_process_va (int pipe_control,
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param lsocks array of listen sockets to dup systemd-style (or NULL);
* must be NULL on platforms where dup is not supported
@@ -528,8 +526,7 @@ GNUNET_OS_start_process_va (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_v (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_v (enum GNUNET_OS_InheritStdioFlags std_inheritance,
const int *lsocks,
const char *filename,
char *const argv[]);
@@ -542,7 +539,6 @@ GNUNET_OS_start_process_v (int pipe_control,
* in the order they appear. Arguments containing spaces can be used by
* quoting them with @em ".
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param lsocks array of listen sockets to dup systemd-style (or NULL);
* must be NULL on platforms where dup is not supported
@@ -554,8 +550,7 @@ GNUNET_OS_start_process_v (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_s (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_s (enum GNUNET_OS_InheritStdioFlags std_inheritance,
const int *lsocks,
const char *filename, ...);
diff --git a/src/nat/gnunet-service-nat_helper.c b/src/nat/gnunet-service-nat_helper.c
index 58d7b4c61..80d3559f3 100644
--- a/src/nat/gnunet-service-nat_helper.c
+++ b/src/nat/gnunet-service-nat_helper.c
@@ -234,8 +234,7 @@ restart_nat_server (void *cls)
"Starting `%s' at `%s'\n",
"gnunet-helper-nat-server",
ia);
- h->server_proc = GNUNET_OS_start_process (GNUNET_NO,
- 0,
+ h->server_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE,
NULL,
h->server_stdout,
NULL,
@@ -378,8 +377,7 @@ GN_request_connection_reversal (const struct in_addr *internal_address,
remv4,
internal_port);
binary = GNUNET_OS_get_suid_binary_path (cfg, "gnunet-helper-nat-client");
- proc = GNUNET_OS_start_process (GNUNET_NO,
- 0,
+ proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE,
NULL,
NULL,
NULL,
diff --git a/src/nat/gnunet-service-nat_mini.c b/src/nat/gnunet-service-nat_mini.c
index ae94e3f5b..b98255ad2 100644
--- a/src/nat/gnunet-service-nat_mini.c
+++ b/src/nat/gnunet-service-nat_mini.c
@@ -199,8 +199,7 @@ GNUNET_NAT_mini_get_external_ipv4_ (GNUNET_NAT_IPCallback cb, void *cb_cls)
eh->task = GNUNET_SCHEDULER_add_now (&signal_external_ip_error, eh);
return eh;
}
- eh->eip = GNUNET_OS_start_process (GNUNET_NO,
- 0,
+ eh->eip = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE,
NULL,
eh->opipe,
NULL,
diff --git a/src/nat/test_nat_test.c b/src/nat/test_nat_test.c
index 43998c97c..2abab4d5f 100644
--- a/src/nat/test_nat_test.c
+++ b/src/nat/test_nat_test.c
@@ -117,8 +117,8 @@ main (int argc, char *const argv[])
return 0;
}
- gns = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ gns = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
"gnunet-nat-server",
"gnunet-nat-server",
diff --git a/src/nat/test_stun.c b/src/nat/test_stun.c
index a41734af1..75eb877b3 100644
--- a/src/nat/test_stun.c
+++ b/src/nat/test_stun.c
@@ -277,8 +277,8 @@ main (int argc, char *const argv[])
/* Lets start resolver */
fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
- proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
fn,
"gnunet-service-resolver",
diff --git a/src/pq/pq_connect.c b/src/pq/pq_connect.c
index 405dca174..e3a610922 100644
--- a/src/pq/pq_connect.c
+++ b/src/pq/pq_connect.c
@@ -162,8 +162,7 @@ apply_patch (struct GNUNET_PQ_Context *db,
"Applying SQL file `%s' on database %s\n",
buf,
db->config_str);
- psql = GNUNET_OS_start_process (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_NONE,
+ psql = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE,
NULL,
NULL,
NULL,
diff --git a/src/statistics/test_statistics_api.c b/src/statistics/test_statistics_api.c
index fcdeccad6..c9e568870 100644
--- a/src/statistics/test_statistics_api.c
+++ b/src/statistics/test_statistics_api.c
@@ -197,8 +197,8 @@ main (int argc, char *argv_ign[])
NULL);
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-statistics",
@@ -225,8 +225,8 @@ main (int argc, char *argv_ign[])
ok = 1;
/* restart to check persistence! */
proc =
- GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-statistics",
diff --git a/src/statistics/test_statistics_api_loop.c b/src/statistics/test_statistics_api_loop.c
index 50507bdc4..ad273287d 100644
--- a/src/statistics/test_statistics_api_loop.c
+++ b/src/statistics/test_statistics_api_loop.c
@@ -98,7 +98,8 @@ main (int argc, char *argv_ign[])
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-statistics",
diff --git a/src/statistics/test_statistics_api_watch.c b/src/statistics/test_statistics_api_watch.c
index 06e639599..2d9d08305 100644
--- a/src/statistics/test_statistics_api_watch.c
+++ b/src/statistics/test_statistics_api_watch.c
@@ -130,7 +130,8 @@ main (int argc, char *argv_ign[])
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-statistics",
diff --git a/src/statistics/test_statistics_api_watch_zero_value.c b/src/statistics/test_statistics_api_watch_zero_value.c
index 80ca57c18..cb2694f8f 100644
--- a/src/statistics/test_statistics_api_watch_zero_value.c
+++ b/src/statistics/test_statistics_api_watch_zero_value.c
@@ -168,7 +168,8 @@ main (int argc, char *argv_ign[])
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-statistics");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
binary,
"gnunet-service-statistics",
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c
index 24c212d6b..03be376fe 100644
--- a/src/testbed/gnunet-helper-testbed.c
+++ b/src/testbed/gnunet-helper-testbed.c
@@ -58,12 +58,6 @@
/**
- * We need pipe control only on WINDOWS
- */
-#define PIPE_CONTROL GNUNET_NO
-
-
-/**
* Context for a single write on a chunk of memory
*/
struct WriteContext
@@ -435,8 +429,7 @@ tokenizer_cb (void *cls, const struct GNUNET_MessageHeader *message)
see putenv(): becomes part of envrionment! */
evstr = NULL;
}
- testbed = GNUNET_OS_start_process (PIPE_CONTROL,
- GNUNET_OS_INHERIT_STD_ERR /*verbose? */,
+ testbed = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR /*verbose? */,
NULL,
NULL,
NULL,
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index f7352250d..152762280 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1384,8 +1384,7 @@ GNUNET_TESTBED_is_host_habitable (
join_argv ((const char **) rsh_args, (const char **) rsh_suffix_args);
free_argv (rsh_suffix_args);
free_argv (rsh_args);
- h->auxp = GNUNET_OS_start_process_vap (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_ERR,
+ h->auxp = GNUNET_OS_start_process_vap (GNUNET_OS_INHERIT_STD_ERR,
NULL,
NULL,
NULL,
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 0ca4c3063..9724fb55b 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -38,12 +38,6 @@
/**
- * We need pipe control only on WINDOWS
- */
-#define PIPE_CONTROL GNUNET_NO
-
-
-/**
* Lowest port used for GNUnet testing. Should be high enough to not
* conflict with other applications running on the hosts but be low
* enough to not conflict with client-ports (typically starting around
@@ -492,8 +486,7 @@ start_shared_service_instance (struct SharedServiceInstance *i)
(void) GNUNET_asprintf (&binary, "gnunet-service-%s", i->ss->sname);
libexec_binary = GNUNET_OS_get_libexec_binary_path (binary);
GNUNET_free (binary);
- i->proc = GNUNET_OS_start_process (PIPE_CONTROL,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ i->proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL,
NULL,
NULL,
@@ -1378,8 +1371,7 @@ GNUNET_TESTING_peer_start (struct GNUNET_TESTING_Peer *peer)
peer->main_binary =
GNUNET_CONFIGURATION_expand_dollar (peer->cfg, peer->main_binary);
peer->main_process =
- GNUNET_OS_start_process_s (PIPE_CONTROL,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process_s (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL,
peer->main_binary,
peer->args,
diff --git a/src/transport/plugin_transport_http_server.c b/src/transport/plugin_transport_http_server.c
index 514f7fd1f..d1b21ba9c 100644
--- a/src/transport/plugin_transport_http_server.c
+++ b/src/transport/plugin_transport_http_server.c
@@ -2188,7 +2188,7 @@ server_load_certificate (struct HTTP_Server_Plugin *plugin)
"No usable TLS certificate found, creating certificate\n");
errno = 0;
cert_creation =
- GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, NULL, NULL,
"gnunet-transport-certificate-creation",
"gnunet-transport-certificate-creation",
diff --git a/src/transport/transport-testing2.c b/src/transport/transport-testing2.c
index 0dc1bb331..2a7a1dfcb 100644
--- a/src/transport/transport-testing2.c
+++ b/src/transport/transport-testing2.c
@@ -915,8 +915,8 @@ communicator_start (
LOG (GNUNET_ERROR_TYPE_DEBUG, "communicator_start\n");
binary = GNUNET_OS_get_libexec_binary_path (binary_name);
- tc_h->c_proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ tc_h->c_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL,
NULL,
NULL,
@@ -967,8 +967,8 @@ resolver_start (struct
LOG (GNUNET_ERROR_TYPE_DEBUG, "resolver_start\n");
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
- tc_h->resolver_proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ tc_h->resolver_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL,
NULL,
NULL,
@@ -999,8 +999,8 @@ nat_start (
LOG (GNUNET_ERROR_TYPE_DEBUG, "nat_start\n");
binary = GNUNET_OS_get_libexec_binary_path ("gnunet-service-nat");
- tc_h->nat_proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ tc_h->nat_proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL,
NULL,
NULL,
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c
index cd23c3a9c..84a3184bc 100644
--- a/src/util/gnunet-qr.c
+++ b/src/util/gnunet-qr.c
@@ -192,8 +192,7 @@ gnunet_uri (void *cls,
GNUNET_array_append (argv,
argc,
NULL);
- p = GNUNET_OS_start_process_vap (GNUNET_NO,
- GNUNET_OS_INHERIT_STD_ALL,
+ p = GNUNET_OS_start_process_vap (GNUNET_OS_INHERIT_STD_ALL,
NULL,
NULL,
NULL,
diff --git a/src/util/gnunet-uri.c b/src/util/gnunet-uri.c
index 48c46ee49..f8754a6d1 100644
--- a/src/util/gnunet-uri.c
+++ b/src/util/gnunet-uri.c
@@ -115,8 +115,7 @@ run (void *cls,
GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ),
&maint_child_death,
NULL);
- p = GNUNET_OS_start_process (GNUNET_NO,
- 0,
+ p = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_NONE,
NULL,
NULL,
NULL,
diff --git a/src/util/helper.c b/src/util/helper.c
index 8c8fb7b6a..7985f2eca 100644
--- a/src/util/helper.c
+++ b/src/util/helper.c
@@ -422,8 +422,9 @@ start_helper (struct GNUNET_HELPER_Handle *h)
GNUNET_DISK_pipe_handle (h->helper_out, GNUNET_DISK_PIPE_END_READ);
h->fh_to_helper =
GNUNET_DISK_pipe_handle (h->helper_in, GNUNET_DISK_PIPE_END_WRITE);
- h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe,
- GNUNET_OS_INHERIT_STD_ERR,
+ h->helper_proc = GNUNET_OS_start_process_vap (h->with_control_pipe
+ ? GNUNET_OS_INHERIT_STD_ERR | GNUNET_OS_USE_PIPE_CONTROL
+ : GNUNET_OS_INHERIT_STD_ERR,
h->helper_in,
h->helper_out,
NULL,
diff --git a/src/util/os_priority.c b/src/util/os_priority.c
index 7f3be2a80..2f86f792f 100644
--- a/src/util/os_priority.c
+++ b/src/util/os_priority.c
@@ -326,7 +326,6 @@ open_dev_null (int target_fd, int flags)
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which
* std handles of the parent are inherited by the child.
* pipe_stdin and pipe_stdout take priority over std_inheritance
@@ -341,8 +340,7 @@ open_dev_null (int target_fd, int flags)
* @return process ID of the new process, -1 on error
*/
static struct GNUNET_OS_Process *
-start_process (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -373,7 +371,7 @@ start_process (int pipe_control,
if (GNUNET_SYSERR ==
GNUNET_OS_check_helper_binary (filename, GNUNET_NO, NULL))
return NULL; /* not executable */
- if (GNUNET_YES == pipe_control)
+ if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL))
{
struct GNUNET_DISK_PipeHandle *childpipe;
int dup_childpipe_read_fd = -1;
@@ -486,7 +484,7 @@ start_process (int pipe_control,
gnunet_proc = GNUNET_new (struct GNUNET_OS_Process);
gnunet_proc->pid = ret;
gnunet_proc->control_pipe = childpipe_write;
- if (GNUNET_YES == pipe_control)
+ if (0 != (std_inheritance & GNUNET_OS_USE_PIPE_CONTROL))
{
close (childpipe_read_fd);
}
@@ -594,7 +592,6 @@ start_process (int pipe_control,
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param pipe_stdin pipe to use to send input to child process (or NULL)
* @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -604,16 +601,14 @@ start_process (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_vap (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_vap (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
struct GNUNET_DISK_PipeHandle *pipe_stderr,
const char *filename,
char *const argv[])
{
- return start_process (pipe_control,
- std_inheritance,
+ return start_process (std_inheritance,
pipe_stdin,
pipe_stdout,
pipe_stderr,
@@ -626,7 +621,6 @@ GNUNET_OS_start_process_vap (int pipe_control,
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param pipe_stdin pipe to use to send input to child process (or NULL)
* @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -636,8 +630,7 @@ GNUNET_OS_start_process_vap (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_va (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_va (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -660,8 +653,7 @@ GNUNET_OS_start_process_va (int pipe_control,
while (NULL != (argv[argc] = va_arg (ap, char *)))
argc++;
va_end (ap);
- ret = GNUNET_OS_start_process_vap (pipe_control,
- std_inheritance,
+ ret = GNUNET_OS_start_process_vap (std_inheritance,
pipe_stdin,
pipe_stdout,
pipe_stderr,
@@ -675,7 +667,6 @@ GNUNET_OS_start_process_va (int pipe_control,
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param pipe_stdin pipe to use to send input to child process (or NULL)
* @param pipe_stdout pipe to use to get output from child process (or NULL)
@@ -684,8 +675,7 @@ GNUNET_OS_start_process_va (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process (enum GNUNET_OS_InheritStdioFlags std_inheritance,
struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
struct GNUNET_DISK_PipeHandle *pipe_stderr,
@@ -696,8 +686,7 @@ GNUNET_OS_start_process (int pipe_control,
va_list ap;
va_start (ap, filename);
- ret = GNUNET_OS_start_process_va (pipe_control,
- std_inheritance,
+ ret = GNUNET_OS_start_process_va (std_inheritance,
pipe_stdin,
pipe_stdout,
pipe_stderr,
@@ -711,7 +700,6 @@ GNUNET_OS_start_process (int pipe_control,
/**
* Start a process.
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags controlling which
* std handles of the parent are inherited by the child.
* pipe_stdin and pipe_stdout take priority over std_inheritance
@@ -723,14 +711,12 @@ GNUNET_OS_start_process (int pipe_control,
* @return process ID of the new process, -1 on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_v (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_v (enum GNUNET_OS_InheritStdioFlags std_inheritance,
const int *lsocks,
const char *filename,
char *const argv[])
{
- return start_process (pipe_control,
- std_inheritance,
+ return start_process (std_inheritance,
NULL,
NULL,
NULL,
@@ -747,7 +733,6 @@ GNUNET_OS_start_process_v (int pipe_control,
* in the order they appear. Arguments containing spaces can be used by
* quoting them with @em ".
*
- * @param pipe_control should a pipe be used to send signals to the child?
* @param std_inheritance a set of GNUNET_OS_INHERIT_STD_* flags
* @param lsocks array of listen sockets to dup systemd-style (or NULL);
* must be NULL on platforms where dup is not supported
@@ -759,8 +744,7 @@ GNUNET_OS_start_process_v (int pipe_control,
* @return pointer to process structure of the new process, NULL on error
*/
struct GNUNET_OS_Process *
-GNUNET_OS_start_process_s (int pipe_control,
- enum GNUNET_OS_InheritStdioFlags std_inheritance,
+GNUNET_OS_start_process_s (enum GNUNET_OS_InheritStdioFlags std_inheritance,
const int *lsocks,
const char *filename,
...)
@@ -869,8 +853,7 @@ GNUNET_OS_start_process_s (int pipe_control,
}
}
binary_path = argv[0];
- proc = GNUNET_OS_start_process_v (pipe_control,
- std_inheritance,
+ proc = GNUNET_OS_start_process_v (std_inheritance,
lsocks,
binary_path,
argv);
@@ -1175,7 +1158,12 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc,
va_start (ap, binary);
/* redirect stdout, don't inherit stderr/stdin */
eip =
- GNUNET_OS_start_process_va (GNUNET_NO, 0, NULL, opipe, NULL, binary, ap);
+ GNUNET_OS_start_process_va (GNUNET_OS_INHERIT_STD_NONE,
+ NULL,
+ opipe,
+ NULL,
+ binary,
+ ap);
va_end (ap);
if (NULL == eip)
{
diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c
index e6d83d52c..ce1cdadd6 100644
--- a/src/util/test_common_logging_runtime_loglevels.c
+++ b/src/util/test_common_logging_runtime_loglevels.c
@@ -403,7 +403,7 @@ runone ()
break;
}
- proc = GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
NULL, pipe_stdout, NULL,
"./test_common_logging_dummy",
"test_common_logging_dummy", NULL);
diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c
index 2bdca5c9d..6d4a131bb 100644
--- a/src/util/test_os_start_process.c
+++ b/src/util/test_os_start_process.c
@@ -138,7 +138,7 @@ run_task (void *cls)
}
proc =
- GNUNET_OS_start_process (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR,
hello_pipe_stdin, hello_pipe_stdout, NULL,
fn,
"test_gnunet_echo_hello", "-", NULL);
@@ -212,7 +212,8 @@ check_kill ()
}
fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
hello_pipe_stdin,
hello_pipe_stdout,
NULL,
@@ -256,7 +257,8 @@ check_instant_kill ()
}
fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
proc =
- GNUNET_OS_start_process (GNUNET_YES, GNUNET_OS_INHERIT_STD_ERR,
+ GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
hello_pipe_stdin, hello_pipe_stdout, NULL,
fn,
"gnunet-service-resolver", "-", NULL);
diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c
index 05716741e..eefb20890 100644
--- a/src/util/test_resolver_api.c
+++ b/src/util/test_resolver_api.c
@@ -348,8 +348,8 @@ main (int argc, char *argv[])
"WARNING",
NULL);
fn = GNUNET_OS_get_libexec_binary_path ("gnunet-service-resolver");
- proc = GNUNET_OS_start_process (GNUNET_YES,
- GNUNET_OS_INHERIT_STD_OUT_AND_ERR,
+ proc = GNUNET_OS_start_process (GNUNET_OS_INHERIT_STD_OUT_AND_ERR
+ | GNUNET_OS_USE_PIPE_CONTROL,
NULL, NULL, NULL,
fn,
"gnunet-service-resolver",