From a1b16f4d5c0dd119f85f13c8cb1399a701a3e815 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 31 Jul 2007 17:09:44 +0000 Subject: start_stop_daemon: NOMMU fix; smaller fixes --- libbb/vfork_daemon_rexec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libbb') diff --git a/libbb/vfork_daemon_rexec.c b/libbb/vfork_daemon_rexec.c index ea7b475eb..f7c620996 100644 --- a/libbb/vfork_daemon_rexec.c +++ b/libbb/vfork_daemon_rexec.c @@ -244,8 +244,6 @@ void bb_daemonize_or_rexec(int flags, char **argv) { int fd; - fd = xopen(bb_dev_null, O_RDWR); - if (flags & DAEMON_CHDIR_ROOT) xchdir("/"); @@ -255,6 +253,8 @@ void bb_daemonize_or_rexec(int flags, char **argv) close(2); } + fd = xopen(bb_dev_null, O_RDWR); + while ((unsigned)fd < 2) fd = dup(fd); /* have 0,1,2 open at least to /dev/null */ -- cgit v1.2.3-55-g6feb