From 9fa95f8539a380e93f760956bc6982e57f5bf3af Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Sat, 23 Aug 2014 15:28:37 +0200 Subject: 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. --- src/core/execute.h | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'src/core/execute.h') 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 #include @@ -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); -- cgit v1.2.3-54-g00ecf