mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00:00
Do not write DEAD_PROCESS records to UTMP, only WTMP
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
49968c188b
commit
3023433def
1 file changed
+5
-5
+5
-5
@@ -70,12 +70,12 @@ int utmp_set(int type, int pid, char *line, char *id, char *user)
|
|||||||
utmp_strncpy(ut.ut_host, uts.release, sizeof(ut.ut_host));
|
utmp_strncpy(ut.ut_host, uts.release, sizeof(ut.ut_host));
|
||||||
ut.ut_tv.tv_sec = time(NULL);
|
ut.ut_tv.tv_sec = time(NULL);
|
||||||
|
|
||||||
setutent();
|
if (type != DEAD_PROCESS) {
|
||||||
while (getutent())
|
setutent();
|
||||||
;
|
result = pututline(&ut) ? 0 : 1;;
|
||||||
result = pututline(&ut) ? 0 : 1;;
|
endutent();
|
||||||
|
}
|
||||||
updwtmp(_PATH_WTMP, &ut);
|
updwtmp(_PATH_WTMP, &ut);
|
||||||
endutent();
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user