Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-11-08 16:07:20 +0300
committerDenys Vlasenko <vda.linux@googlemail.com>2023-11-08 16:07:20 +0300
commit58ca629fd27cd9d7f91a8ea90435cdb3f15381aa (patch)
tree6cd26e1bd56e7eed350ff8fa3d4aeecf58ef3a22 /include
parent2de67a62e812f2e4d13280f2b78712b6d344cfb7 (diff)
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.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 0883fb565..ef5d04713 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. */