- STRUCT_UTMP *uptr;
- STRUCT_UTMP *utmp_contents;
-
- if (utmpname (filename))
- {
- return 1;
- }
-
- /* FIXME: going through the list twice is wasteful. */
-
- /* count the entries in utmp */
- setutent ();
- while ((u = getutent ()) != NULL)
- ++count_utmp;
-
- if (count_utmp == 0)
- return 0;
-
- utmp_contents = (STRUCT_UTMP *) xmalloc (count_utmp * sizeof (STRUCT_UTMP));