aboutsummaryrefslogtreecommitdiff
path: root/printutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 23:04:17 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 23:04:17 +0200
commitb182e9ad6011909fdb76358431d23d195febaf54 (patch)
tree650b66e06387f8b0f7fe054a53150809aede7701 /printutils
parent692eeb81a4c54d7d8bf0d2e370c12762b2a16ff7 (diff)
downloadbusybox-w32-b182e9ad6011909fdb76358431d23d195febaf54.tar.gz
busybox-w32-b182e9ad6011909fdb76358431d23d195febaf54.tar.bz2
busybox-w32-b182e9ad6011909fdb76358431d23d195febaf54.zip
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 'printutils')
-rw-r--r--printutils/lpd.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/printutils/lpd.c b/printutils/lpd.c
index 3fdba5d2b..662d3a224 100644
--- a/printutils/lpd.c
+++ b/printutils/lpd.c
@@ -198,9 +198,8 @@ int lpd_main(int argc UNUSED_PARAM, char *argv[])
198 q = p; // next line 198 q = p; // next line
199 } 199 }
200 // helper should not talk over network. 200 // helper should not talk over network.
201 // this call reopens stdio fds to "/dev/null" 201 // this call reopens stdio fds to "/dev/null".
202 // (no daemonization is done) 202 bb_daemon_helper(DAEMON_DEVNULL_STDIO);
203 bb_daemonize_or_rexec(DAEMON_DEVNULL_STDIO | DAEMON_ONLY_SANITIZE, NULL);
204 BB_EXECVP_or_die(argv); 203 BB_EXECVP_or_die(argv);
205 } 204 }
206 205