+ switch (utx->ut_type) {
+ case EMPTY:
+@@ -155,21 +284,21 @@ getutxid(const struct utmpx *utx)
+ case BOOT_TIME:
+ case OLD_TIME:
+ case NEW_TIME:
+- if (ut.ut_type == utx->ut_type)
+- return &ut;
++ if (U->ut.ut_type == utx->ut_type)
++ return &U->ut;
+ break;
+ case INIT_PROCESS:
+ case LOGIN_PROCESS:
+ case USER_PROCESS:
+ case DEAD_PROCESS:
+- switch (ut.ut_type) {
++ switch (U->ut.ut_type) {
+ case INIT_PROCESS:
+ case LOGIN_PROCESS:
+ case USER_PROCESS:
+ case DEAD_PROCESS:
+- if (memcmp(ut.ut_id, utx->ut_id,
+- sizeof(ut.ut_id)) == 0)
+- return &ut;
++ if (memcmp(U->ut.ut_id, utx->ut_id,
++ sizeof(U->ut.ut_id)) == 0)
++ return &U->ut;
+ break;
+ default:
+ break;
+@@ -178,188 +307,253 @@ getutxid(const struct utmpx *utx)
+ default:
+ return NULL;
+ }
+- } while (getutxent() != NULL);
++ } while (__getutxent(U) != NULL);
+ return NULL;
+ }
+
+
+-struct utmpx *
+-getutxline(const struct utmpx *utx)
++static struct utmpx *
++__getutxline(struct _utmpx *U, const struct utmpx *utx)
+ {
+-
+- _DIAGASSERT(utx != NULL);
+-
+ do {
+- switch (ut.ut_type) {
++ switch (U->ut.ut_type) {
+ case EMPTY:
+ break;
+ case LOGIN_PROCESS:
+ case USER_PROCESS:
+- if (strncmp(ut.ut_line, utx->ut_line,
+- sizeof(ut.ut_line)) == 0)
+- return &ut;
++ if (strncmp(U->ut.ut_line, utx->ut_line,
++ sizeof(U->ut.ut_line)) == 0)
++ return &U->ut;
+ break;
+ default:
+ break;
+ }
+- } while (getutxent() != NULL);
++ } while (__getutxent(U) != NULL);
+ return NULL;
+ }
+
+