mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-11-25 04:39:48 +00:00
Patch from Manousaridis Angelos to cleanup stale file descriptors, it was preventing unmounting an initial filesystem.
This commit is contained in:
parent
a4d27d2d38
commit
b619419962
@ -504,7 +504,8 @@ static void update_utmp(char *line)
|
||||
* entry in the utmp file.
|
||||
*/
|
||||
if (access(_PATH_UTMP, R_OK|W_OK) == -1) {
|
||||
creat(_PATH_UTMP, 0664);
|
||||
int fd = creat(_PATH_UTMP, 0664);
|
||||
close(fd);
|
||||
}
|
||||
utmpname(_PATH_UTMP);
|
||||
setutent();
|
||||
@ -535,7 +536,8 @@ static void update_utmp(char *line)
|
||||
|
||||
{
|
||||
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
|
||||
creat(_PATH_WTMP, 0664);
|
||||
int fd = creat(_PATH_WTMP, 0664);
|
||||
close(fd);
|
||||
}
|
||||
updwtmp(_PATH_WTMP, &ut);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user