Save a line or two
This commit is contained in:
parent
97a1de10e9
commit
713d6e3dd3
@ -504,8 +504,7 @@ static void update_utmp(char *line)
|
|||||||
* entry in the utmp file.
|
* entry in the utmp file.
|
||||||
*/
|
*/
|
||||||
if (access(_PATH_UTMP, R_OK|W_OK) == -1) {
|
if (access(_PATH_UTMP, R_OK|W_OK) == -1) {
|
||||||
int fd = creat(_PATH_UTMP, 0664);
|
close(creat(_PATH_UTMP, 0664));
|
||||||
close(fd);
|
|
||||||
}
|
}
|
||||||
utmpname(_PATH_UTMP);
|
utmpname(_PATH_UTMP);
|
||||||
setutent();
|
setutent();
|
||||||
@ -536,8 +535,7 @@ static void update_utmp(char *line)
|
|||||||
|
|
||||||
{
|
{
|
||||||
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
|
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
|
||||||
int fd = creat(_PATH_WTMP, 0664);
|
close(creat(_PATH_WTMP, 0664));
|
||||||
close(fd);
|
|
||||||
}
|
}
|
||||||
updwtmp(_PATH_WTMP, &ut);
|
updwtmp(_PATH_WTMP, &ut);
|
||||||
}
|
}
|
||||||
|
@ -479,8 +479,7 @@ static void setutmp(const char *name, const char *line)
|
|||||||
pututline(&utent);
|
pututline(&utent);
|
||||||
endutent();
|
endutent();
|
||||||
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
|
if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
|
||||||
int fd = creat(_PATH_WTMP, 0664);
|
close(creat(_PATH_WTMP, 0664));
|
||||||
close(fd);
|
|
||||||
}
|
}
|
||||||
updwtmp(_PATH_WTMP, &utent);
|
updwtmp(_PATH_WTMP, &utent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user