Parse DEAD_PROCESS entries properly.

The TTY line name should always be set for DEAD_PROCESS entries right
now. When we parse a clean utmp entry, we don't want to interpret it as
a DEAD_PROCESS entry if the TTY has never been used yet.
This commit is contained in:
Ed Schouten 2009-12-27 22:26:29 +00:00
parent 745abd5963
commit 4a1f09d742
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=201064

View file

@ -71,7 +71,7 @@ ulog_futmp_to_utmpx(const struct futmp *ut, struct ulog_utmpx *utx)
utx->ut_type = NEW_TIME;
else if (MATCH(user, "shutdown") && MATCH(line, "~"))
utx->ut_type = SHUTDOWN_TIME;
else if (MATCH(user, "") && MATCH(host, "")) {
else if (MATCH(user, "") && MATCH(host, "") && !MATCH(line, "")) {
utx->ut_type = DEAD_PROCESS;
/* XXX: ut_id and ut_pid missing. ut_line not needed. */
COPY_STRING(line);