summaryrefslogtreecommitdiff
path: root/libbb/vfork_daemon_rexec.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-07-31 17:09:44 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-07-31 17:09:44 +0000
commita1b16f4d5c0dd119f85f13c8cb1399a701a3e815 (patch)
treeb306578a615c33768fbd00ca05f5fbfab3787267 /libbb/vfork_daemon_rexec.c
parentf1f1b69dc12d489ef8b8cd1fb4114d404407e481 (diff)
downloadbusybox-w32-a1b16f4d5c0dd119f85f13c8cb1399a701a3e815.tar.gz
busybox-w32-a1b16f4d5c0dd119f85f13c8cb1399a701a3e815.tar.bz2
busybox-w32-a1b16f4d5c0dd119f85f13c8cb1399a701a3e815.zip
start_stop_daemon: NOMMU fix; smaller fixes
Diffstat (limited to 'libbb/vfork_daemon_rexec.c')
-rw-r--r--libbb/vfork_daemon_rexec.c4
1 files changed, 2 insertions, 2 deletions
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)
244{ 244{
245 int fd; 245 int fd;
246 246
247 fd = xopen(bb_dev_null, O_RDWR);
248
249 if (flags & DAEMON_CHDIR_ROOT) 247 if (flags & DAEMON_CHDIR_ROOT)
250 xchdir("/"); 248 xchdir("/");
251 249
@@ -255,6 +253,8 @@ void bb_daemonize_or_rexec(int flags, char **argv)
255 close(2); 253 close(2);
256 } 254 }
257 255
256 fd = xopen(bb_dev_null, O_RDWR);
257
258 while ((unsigned)fd < 2) 258 while ((unsigned)fd < 2)
259 fd = dup(fd); /* have 0,1,2 open at least to /dev/null */ 259 fd = dup(fd); /* have 0,1,2 open at least to /dev/null */
260 260