aboutsummaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-12-05 07:44:02 +0000
committerRon Yorston <rmy@pobox.com>2023-12-05 07:44:02 +0000
commit7dff7f37600209353cf4e86d1cca29bacf5f7372 (patch)
treefd2d62684e46663ebd435391058dcf8558c6b70d /libbb/vfork_daemon_rexec.c
parentf444dc586b16c104a82d201d3a7caca68affe51b (diff)
parent28f41260935852eda6bd8ab1f26347c012ae0a53 (diff)
downloadbusybox-w32-7dff7f37600209353cf4e86d1cca29bacf5f7372.tar.gz
busybox-w32-7dff7f37600209353cf4e86d1cca29bacf5f7372.tar.bz2
busybox-w32-7dff7f37600209353cf4e86d1cca29bacf5f7372.zip
Merge branch 'busybox' into mergeFRP-5236-g7dff7f376
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c
index 3845c0892..dad50ddb9 100644
--- a/libbb/vfork_daemon_rexec.c
+++ b/libbb/vfork_daemon_rexec.c
@@ -301,9 +301,12 @@ void FAST_FUNC bb_daemonize_or_rexec(int flags, char **argv)
301 } 301 }
302 302
303 if (flags & DAEMON_DEVNULL_STDIO) { 303 if (flags & DAEMON_DEVNULL_STDIO) {
304 xdup2(fd, 0); 304 if (flags & DAEMON_DEVNULL_STDIN)
305 xdup2(fd, 1); 305 xdup2(fd, 0);
306 xdup2(fd, 2); 306 if (flags & DAEMON_DEVNULL_OUTERR) {
307 xdup2(fd, 1);
308 xdup2(fd, 2);
309 }
307 } else { 310 } else {
308 /* have 0,1,2 open at least to /dev/null */ 311 /* have 0,1,2 open at least to /dev/null */
309 while ((unsigned)fd < 2) 312 while ((unsigned)fd < 2)