small fixes: using fd-based io instead of FILE*-based,

missed O_TRUNC, etc
This commit is contained in:
Denis Vlasenko
2006-11-18 22:03:26 +00:00
parent 5a3395bc01
commit 61126ab30a
5 changed files with 63 additions and 62 deletions

View File

@ -29,9 +29,7 @@ long uptime(void)
*/
static inline void sanitize_fds(void)
{
int fd = open(bb_dev_null, O_RDWR, 0);
if (fd < 0)
return;
int fd = xopen(bb_dev_null, O_RDWR);
while (fd < 3)
fd = dup(fd);
close(fd);