Use USER_PROCESS instead of LOGIN_PROCESS.

POSIX isn't clear about how the fields should be used, but according to
utmpx(5) on Linux, LOGIN_PROCESS refers to a TTY that's still running a
getty.
This commit is contained in:
Ed Schouten 2009-12-03 17:05:36 +00:00
parent 42b525af6e
commit 178442d07a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200067
4 changed files with 7 additions and 7 deletions

View file

@ -71,11 +71,11 @@ struct ulog_utmpx {
#endif
#define OLD_TIME 2
#define NEW_TIME 3
#if 0
#define USER_PROCESS 4
#if 0
#define INIT_PROCESS 5
#endif
#define LOGIN_PROCESS 6
#endif
#define DEAD_PROCESS 7
#define SHUTDOWN_TIME 8

View file

@ -73,15 +73,15 @@ The
.Fa ut_type
field contains the type of the message, which may have one of the
following values:
.Bl -tag -width LOGIN_PROCESS
.Bl -tag -width SHUTDOWN_TIME
.It Dv EMPTY
No valid user accounting information.
.It Dv OLD_TIME
Identifies time when system clock changed.
.It Dv NEW_TIME
Identifies time after system clock changed.
.It Dv LOGIN_PROCESS
Identifies the session leader of a logged in user.
.It Dv USER_PROCESS
Identifies a process.
.It Dv DEAD_PROCESS
Identifies a session leader who has exited.
.It Dv SHUTDOWN_TIME

View file

@ -82,7 +82,7 @@ ulog_getutxent(void)
else if (MATCH(user, "") && MATCH(host, ""))
utx.ut_type = DEAD_PROCESS;
else if (!MATCH(user, ""))
utx.ut_type = LOGIN_PROCESS;
utx.ut_type = USER_PROCESS;
else
utx.ut_type = EMPTY;

View file

@ -80,7 +80,7 @@ main(int argc, char **argv)
ulog_setutxent();
while ((ut = ulog_getutxent()) != NULL) {
if (ut->ut_type != LOGIN_PROCESS)
if (ut->ut_type != USER_PROCESS)
continue;
if (ncnt >= nmax) {
nmax += 32;