diff options
author | Denys Vlasenko | 2023-11-08 14:07:20 +0100 |
---|---|---|
committer | Denys Vlasenko | 2023-11-08 14:07:20 +0100 |
commit | 58ca629fd27cd9d7f91a8ea90435cdb3f15381aa (patch) | |
tree | 6cd26e1bd56e7eed350ff8fa3d4aeecf58ef3a22 /include | |
parent | 2de67a62e812f2e4d13280f2b78712b6d344cfb7 (diff) | |
download | busybox-58ca629fd27cd9d7f91a8ea90435cdb3f15381aa.zip busybox-58ca629fd27cd9d7f91a8ea90435cdb3f15381aa.tar.gz |
start-stop-daemon: do not lose error messages with -b
function old new delta
start_stop_daemon_main 1186 1206 +20
bb_daemonize_or_rexec 196 212 +16
bb_banner 47 46 -1
packed_usage 34656 34645 -11
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 2/2 up/down: 36/-12) Total: 24 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h index 0883fb5..ef5d047 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1309,10 +1309,12 @@ void _exit_FAILURE(void) NORETURN FAST_FUNC; */ enum { DAEMON_CHDIR_ROOT = 1 << 0, - DAEMON_DEVNULL_STDIO = 1 << 1, - DAEMON_CLOSE_EXTRA_FDS = 1 << 2, - DAEMON_ONLY_SANITIZE = 1 << 3, /* internal use */ - //DAEMON_DOUBLE_FORK = 1 << 4, /* double fork to avoid controlling tty */ + DAEMON_DEVNULL_STDIN = 1 << 1, + DAEMON_DEVNULL_OUTERR = 2 << 1, + DAEMON_DEVNULL_STDIO = 3 << 1, + DAEMON_CLOSE_EXTRA_FDS = 1 << 3, + DAEMON_ONLY_SANITIZE = 1 << 4, /* internal use */ + //DAEMON_DOUBLE_FORK = 1 << 5, /* double fork to avoid controlling tty */ }; #if BB_MMU enum { re_execed = 0 }; @@ -1335,6 +1337,7 @@ enum { # define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu() #endif void bb_daemonize_or_rexec(int flags, char **argv) FAST_FUNC; +/* Unlike bb_daemonize_or_rexec, these two helpers do not setsid: */ void bb_sanitize_stdio(void) FAST_FUNC; #define bb_daemon_helper(arg) bb_daemonize_or_rexec((arg) | DAEMON_ONLY_SANITIZE, NULL) /* Clear dangerous stuff, set PATH. Return 1 if was run by different user. */ |