Save a line or two

This commit is contained in:
Eric Andersen 2004-08-26 22:26:26 +00:00
parent 97a1de10e9
commit 713d6e3dd3
2 changed files with 3 additions and 6 deletions

View File

@ -504,8 +504,7 @@ static void update_utmp(char *line)
* entry in the utmp file.
*/
if (access(_PATH_UTMP, R_OK|W_OK) == -1) {
int fd = creat(_PATH_UTMP, 0664);
close(fd);
close(creat(_PATH_UTMP, 0664));
}
utmpname(_PATH_UTMP);
setutent();
@ -536,8 +535,7 @@ static void update_utmp(char *line)
{
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
int fd = creat(_PATH_WTMP, 0664);
close(fd);
close(creat(_PATH_WTMP, 0664));
}
updwtmp(_PATH_WTMP, &ut);
}

View File

@ -479,8 +479,7 @@ static void setutmp(const char *name, const char *line)
pututline(&utent);
endutent();
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
int fd = creat(_PATH_WTMP, 0664);
close(fd);
close(creat(_PATH_WTMP, 0664));
}
updwtmp(_PATH_WTMP, &utent);
}