aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2023-11-08 14:07:20 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2023-11-08 14:07:20 +0100
commit58ca629fd27cd9d7f91a8ea90435cdb3f15381aa (patch)
tree6cd26e1bd56e7eed350ff8fa3d4aeecf58ef3a22 /include
parent2de67a62e812f2e4d13280f2b78712b6d344cfb7 (diff)
downloadbusybox-w32-58ca629fd27cd9d7f91a8ea90435cdb3f15381aa.tar.gz
busybox-w32-58ca629fd27cd9d7f91a8ea90435cdb3f15381aa.tar.bz2
busybox-w32-58ca629fd27cd9d7f91a8ea90435cdb3f15381aa.zip
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;
1309 */ 1309 */
1310enum { 1310enum {
1311 DAEMON_CHDIR_ROOT = 1 << 0, 1311 DAEMON_CHDIR_ROOT = 1 << 0,
1312 DAEMON_DEVNULL_STDIO = 1 << 1, 1312 DAEMON_DEVNULL_STDIN = 1 << 1,
1313 DAEMON_CLOSE_EXTRA_FDS = 1 << 2, 1313 DAEMON_DEVNULL_OUTERR = 2 << 1,
1314 DAEMON_ONLY_SANITIZE = 1 << 3, /* internal use */ 1314 DAEMON_DEVNULL_STDIO = 3 << 1,
1315 //DAEMON_DOUBLE_FORK = 1 << 4, /* double fork to avoid controlling tty */ 1315 DAEMON_CLOSE_EXTRA_FDS = 1 << 3,
1316 DAEMON_ONLY_SANITIZE = 1 << 4, /* internal use */
1317 //DAEMON_DOUBLE_FORK = 1 << 5, /* double fork to avoid controlling tty */
1316}; 1318};
1317#if BB_MMU 1319#if BB_MMU
1318 enum { re_execed = 0 }; 1320 enum { re_execed = 0 };
@@ -1335,6 +1337,7 @@ enum {
1335# define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu() 1337# define bb_daemonize(a) BUG_bb_daemonize_is_unavailable_on_nommu()
1336#endif 1338#endif
1337void bb_daemonize_or_rexec(int flags, char **argv) FAST_FUNC; 1339void bb_daemonize_or_rexec(int flags, char **argv) FAST_FUNC;
1340/* Unlike bb_daemonize_or_rexec, these two helpers do not setsid: */
1338void bb_sanitize_stdio(void) FAST_FUNC; 1341void bb_sanitize_stdio(void) FAST_FUNC;
1339#define bb_daemon_helper(arg) bb_daemonize_or_rexec((arg) | DAEMON_ONLY_SANITIZE, NULL) 1342#define bb_daemon_helper(arg) bb_daemonize_or_rexec((arg) | DAEMON_ONLY_SANITIZE, NULL)
1340/* Clear dangerous stuff, set PATH. Return 1 if was run by different user. */ 1343/* Clear dangerous stuff, set PATH. Return 1 if was run by different user. */