- endutent();
- return (utmped = NOTOK);
-}
-#else
-static int
-logged_in (void)
-{
- struct utmp ut;
- FILE *uf;
-
- if (utmped)
- return utmped;
-
- if ((uf = fopen (UTMP_FILE, "r")) == NULL)
- return NOTOK;
-
- while (fread ((char *) &ut, sizeof(ut), 1, uf) == 1) {
- if (ut.ut_name[0] != 0
- && strncmp (user, ut.ut_name, sizeof(ut.ut_name)) == 0) {
- if (debug)
- continue;
- fclose (uf);
- return (utmped = DONE);
- }
- }
-
- fclose (uf);