start_stop_daemon: NOMMU fix; smaller fixes

This commit is contained in:
Denis Vlasenko
2007-07-31 17:09:44 +00:00
parent f1f1b69dc1
commit a1b16f4d5c
3 changed files with 52 additions and 39 deletions

View File

@@ -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 */