From 2075aa93e007863c6b680994a7a0ba420181034f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 2 Dec 2020 21:28:47 +0100 Subject: libbb: rename run_shell() to exec_shell() Signed-off-by: Denys Vlasenko --- libbb/executable.c | 9 --------- libbb/run_shell.c | 13 +++++++++++-- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'libbb') diff --git a/libbb/executable.c b/libbb/executable.c index 29d2a2c85..a033b74d9 100644 --- a/libbb/executable.c +++ b/libbb/executable.c @@ -91,12 +91,3 @@ void FAST_FUNC BB_EXECVP_or_die(char **argv) xfunc_error_retval = (errno == ENOENT) ? 127 : 126; bb_perror_msg_and_die("can't execute '%s'", argv[0]); } - -/* Typical idiom for applets which exec *optional* PROG [ARGS] */ -void FAST_FUNC exec_prog_or_SHELL(char **argv) -{ - if (argv[0]) { - BB_EXECVP_or_die(argv); - } - run_shell(getenv("SHELL"), /*login:*/ 1, NULL); -} diff --git a/libbb/run_shell.c b/libbb/run_shell.c index a0420d982..c2ff69651 100644 --- a/libbb/run_shell.c +++ b/libbb/run_shell.c @@ -48,10 +48,10 @@ void FAST_FUNC set_current_security_context(security_context_t sid) #endif -/* Run SHELL, or DEFAULT_SHELL if SHELL is "" or NULL. +/* Exec SHELL, or DEFAULT_SHELL if SHELL is "" or NULL. * If ADDITIONAL_ARGS is not NULL, pass them to the shell. */ -void FAST_FUNC run_shell(const char *shell, int loginshell, const char **additional_args) +void FAST_FUNC exec_shell(const char *shell, int loginshell, const char **additional_args) { const char **args; @@ -84,3 +84,12 @@ void FAST_FUNC run_shell(const char *shell, int loginshell, const char **additio execv(shell, (char **) args); bb_perror_msg_and_die("can't execute '%s'", shell); } + +/* Typical idiom for applets which exec *optional* PROG [ARGS] */ +void FAST_FUNC exec_prog_or_SHELL(char **argv) +{ + if (argv[0]) { + BB_EXECVP_or_die(argv); + } + exec_shell(getenv("SHELL"), /*login:*/ 1, NULL); +} -- cgit v1.2.3