summaryrefslogtreecommitdiff
path: root/loginutils/login.c
diff options
context:
space:
mode:
authorGlenn L McGrath2004-08-25 02:02:19 +0000
committerGlenn L McGrath2004-08-25 02:02:19 +0000
commitb61941996224f3b9314973ef52b413dcc916f74d (patch)
tree864d8f56be7bd356e209d4f1b2261b03ffdfef18 /loginutils/login.c
parenta4d27d2d385db205a9e6a0983985e02085f910ef (diff)
downloadbusybox-b61941996224f3b9314973ef52b413dcc916f74d.zip
busybox-b61941996224f3b9314973ef52b413dcc916f74d.tar.gz
Patch from Manousaridis Angelos to cleanup stale file descriptors, it was preventing unmounting an initial filesystem.
Diffstat (limited to 'loginutils/login.c')
-rw-r--r--loginutils/login.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index f5e950f..4786d11 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -479,7 +479,8 @@ static void setutmp(const char *name, const char *line)
pututline(&utent);
endutent();
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
- creat(_PATH_WTMP, 0664);
+ int fd = creat(_PATH_WTMP, 0664);
+ close(fd);
}
updwtmp(_PATH_WTMP, &utent);
}