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 #endif
#define OLD_TIME 2 #define OLD_TIME 2
#define NEW_TIME 3 #define NEW_TIME 3
#if 0
#define USER_PROCESS 4 #define USER_PROCESS 4
#if 0
#define INIT_PROCESS 5 #define INIT_PROCESS 5
#endif
#define LOGIN_PROCESS 6 #define LOGIN_PROCESS 6
#endif
#define DEAD_PROCESS 7 #define DEAD_PROCESS 7
#define SHUTDOWN_TIME 8 #define SHUTDOWN_TIME 8

View file

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

View file

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

View file

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