aboutsummaryrefslogtreecommitdiff
path: root/src/arm/do_start_process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm/do_start_process.c')
-rw-r--r--src/arm/do_start_process.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/arm/do_start_process.c b/src/arm/do_start_process.c
index 4554f57..b4bb10c 100644
--- a/src/arm/do_start_process.c
+++ b/src/arm/do_start_process.c
@@ -1,3 +1,23 @@
+/*
+ This file is part of GNUnet.
+ (C) 2011, 2012 Christian Grothoff (and other contributing authors)
+
+ GNUnet is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GNUnet is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNUnet; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
/**
* Actually start a process. All of the arguments given to this
* function are strings that are used for the "argv" array. However,
@@ -8,13 +28,14 @@
* with spaces to the new 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 starting at fd3 (systemd-style), or NULL
* @param first_arg first argument for argv (may be an empty string)
* @param ... more arguments, NULL terminated
* @return handle of the started process, NULL on error
*/
static struct GNUNET_OS_Process *
-do_start_process (int pipe_control,
+do_start_process (int pipe_control, unsigned int std_inheritance,
const SOCKTYPE * lsocks, const char *first_arg, ...)
{
va_list ap;
@@ -26,6 +47,7 @@ do_start_process (int pipe_control,
char *cp;
const char *last;
struct GNUNET_OS_Process *proc;
+ char *binary_path;
argv_size = 1;
va_start (ap, first_arg);
@@ -97,9 +119,13 @@ do_start_process (int pipe_control,
/* *INDENT-ON* */
va_end (ap);
argv[argv_size] = NULL;
- proc = GNUNET_OS_start_process_v (pipe_control, lsocks, argv[0], argv);
+ binary_path = argv[0];
+ proc = GNUNET_OS_start_process_v (pipe_control, std_inheritance, lsocks,
+ binary_path, argv);
while (argv_size > 0)
GNUNET_free (argv[--argv_size]);
GNUNET_free (argv);
return proc;
}
+
+/* end of do_start_process.c */