svn commit: r201064 - head/lib/libulog

[ Available lists | Index of svn-src-head | Month of Dec 2009 | Week of 27 Dec 2009 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Ed Schouten <ed@FreeBSD.org>
Date
27 Dec 2009 22:26:29
Subject
svn commit: r201064 - head/lib/libulog
Message-ID
200912272226.nBRMQTu8069322@svn.freebsd.org


[ Hide this part ]
Author: ed
Date: Sun Dec 27 22:26:29 2009
New Revision: 201064
URL: http://svn.freebsd.org/changeset/base/201064

Log:
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.

Modified:
head/lib/libulog/ulog_getutxent.c

Modified: head/lib/libulog/ulog_getutxent.c
==============================================================================
--- head/lib/libulog/ulog_getutxent.c Sun Dec 27 22:13:19 2009 (r201063)
+++ head/lib/libulog/ulog_getutxent.c Sun Dec 27 22:26:29 2009 (r201064)
@@ -71,7 +71,7 @@ ulog_futmp_to_utmpx(const struct futmp *
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);

Elapsed time: 0.140 seconds