diff options
author | Denys Vlasenko | 2017-08-04 23:04:17 +0200 |
---|---|---|
committer | Denys Vlasenko | 2017-08-04 23:04:17 +0200 |
commit | b182e9ad6011909fdb76358431d23d195febaf54 (patch) | |
tree | 650b66e06387f8b0f7fe054a53150809aede7701 /include | |
parent | 692eeb81a4c54d7d8bf0d2e370c12762b2a16ff7 (diff) | |
download | busybox-b182e9ad6011909fdb76358431d23d195febaf54.zip busybox-b182e9ad6011909fdb76358431d23d195febaf54.tar.gz |
libbb: use _exit, not exit, in bb_daemonize_or_rexec()
By the time we reach exit in parent, child already exited or execed.
We should not re-run libc cleanup code.
While at it, introduce bb_daemon_helper() and add a few comments.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libbb.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index bb27c59..6a2a2d6 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1169,6 +1169,7 @@ enum { #endif void bb_daemonize_or_rexec(int flags, char **argv) FAST_FUNC; 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. */ int sanitize_env_if_suid(void) FAST_FUNC; |