diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2005-03-30 05:23:17 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2005-03-30 05:23:17 +0000 |
commit | 08b59778675d670a6dc3e88ce79311388b0c2385 (patch) | |
tree | f7a1463401b852db8fa408df25d0cd0ad5ff53c5 | |
parent | 733abad3edff116fffc3151eed98b44c476d14a9 (diff) | |
download | coreutils-08b59778675d670a6dc3e88ce79311388b0c2385.tar.xz |
(users): New arg OPTIONS. All uses changed.
(main): Check PIDs when invoked with zero arguments.
-rw-r--r-- | src/users.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/users.c b/src/users.c index a8851f348..7f9be7396 100644 --- a/src/users.c +++ b/src/users.c @@ -1,5 +1,5 @@ /* GNU's users. - Copyright (C) 1992-2004 Free Software Foundation, Inc. + Copyright (C) 1992-2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -80,15 +80,16 @@ list_entries_users (size_t n, const STRUCT_UTMP *this) free (u); } -/* Display a list of users on the system, according to utmp file FILENAME. */ +/* Display a list of users on the system, according to utmp file FILENAME. + Use read_utmp OPTIONS to read FILENAME. */ static void -users (const char *filename) +users (const char *filename, int options) { size_t n_users; STRUCT_UTMP *utmp_buf; - if (read_utmp (filename, &n_users, &utmp_buf) != 0) + if (read_utmp (filename, &n_users, &utmp_buf, options) != 0) error (EXIT_FAILURE, errno, "%s", filename); list_entries_users (n_users, utmp_buf); @@ -137,11 +138,11 @@ main (int argc, char **argv) switch (argc - optind) { case 0: /* users */ - users (UTMP_FILE); + users (UTMP_FILE, READ_UTMP_CHECK_PIDS); break; case 1: /* users <utmp file> */ - users (argv[optind]); + users (argv[optind], 0); break; default: /* lose */ |