Display a list of who is on the system, according to utmp file FILENAME. Use read_utmp OPTIONS to read the file. */
| 603 | /* Display a list of who is on the system, according to utmp file FILENAME. |
| 604 | Use read_utmp OPTIONS to read the file. */ |
| 605 | static void |
| 606 | who (char const *filename, int options) |
| 607 | { |
| 608 | idx_t n_users; |
| 609 | STRUCT_UTMP *utmp_buf; |
| 610 | if (short_list) |
| 611 | options |= READ_UTMP_USER_PROCESS; |
| 612 | if (read_utmp (filename, &n_users, &utmp_buf, options) != 0) |
| 613 | error (EXIT_FAILURE, errno, "%s", quotef (filename)); |
| 614 | |
| 615 | if (short_list) |
| 616 | list_entries_who (n_users, utmp_buf); |
| 617 | else |
| 618 | scan_entries (n_users, utmp_buf); |
| 619 | |
| 620 | free (utmp_buf); |
| 621 | } |
| 622 | |
| 623 | void |
| 624 | usage (int status) |
no test coverage detected