diff options
author | Daniel Mack <zonque@gmail.com> | 2014-08-23 15:28:37 +0200 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2014-09-05 12:18:57 +0200 |
commit | 9fa95f8539a380e93f760956bc6982e57f5bf3af (patch) | |
tree | f774c011d5563d2d381e91e1b50ac5c1e2e674e6 /src/core/execute.h | |
parent | a4390b6be8869172ccdd16fef208803fc6c7a114 (diff) |
exec: factor out most function arguments of exec_spawn() to ExecParameters
This way, the list of arguments to that function gets more comprehensive,
and we can get around passing lots of NULL and 0 arguments from socket.c,
swap.c and mount.c.
It also allows for splitting up the code in exec_spawn().
While at it, make ExecContext const in execute.c.
Diffstat (limited to 'src/core/execute.h')
-rw-r--r-- | src/core/execute.h | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/core/execute.h b/src/core/execute.h index 9d05d3a9de..f31f0c9f27 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -25,6 +25,7 @@ typedef struct ExecStatus ExecStatus; typedef struct ExecCommand ExecCommand; typedef struct ExecContext ExecContext; typedef struct ExecRuntime ExecRuntime; +typedef struct ExecParameters ExecParameters; #include <linux/types.h> #include <sys/time.h> @@ -191,21 +192,25 @@ struct ExecContext { #include "cgroup.h" +struct ExecParameters { + char **argv; + int *fds; unsigned n_fds; + char **environment; + bool apply_permissions; + bool apply_chroot; + bool apply_tty_stdin; + bool confirm_spawn; + CGroupControllerMask cgroup_supported; + const char *cgroup_path; + const char *runtime_prefix; + const char *unit_id; + usec_t watchdog_usec; + int *idle_pipe; +}; + int exec_spawn(ExecCommand *command, - char **argv, - ExecContext *context, - int fds[], unsigned n_fds, - char **environment, - bool apply_permissions, - bool apply_chroot, - bool apply_tty_stdin, - bool confirm_spawn, - CGroupControllerMask cgroup_mask, - const char *cgroup_path, - const char *runtime_prefix, - const char *unit_id, - usec_t watchdog_usec, - int pipe_fd[2], + const ExecContext *context, + const ExecParameters *exec_params, ExecRuntime *runtime, pid_t *ret); |