diff options
author | Jim Meyering <jim@meyering.net> | 1997-07-13 03:57:00 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-07-13 03:57:00 +0000 |
commit | 7fe4db1451f4d000243a5a1debaf5d1fc43cb504 (patch) | |
tree | 963c2b0c26da63e367c9b41f206c8333c7022355 /src | |
parent | 393e4a8c36a42e172b4bea8d5e22e02bb05cbdce (diff) | |
download | coreutils-7fe4db1451f4d000243a5a1debaf5d1fc43cb504.tar.xz |
(users): Update read_utmp caller.
Diffstat (limited to 'src')
-rw-r--r-- | src/users.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/users.c b/src/users.c index e27bda5c7..a3b72453c 100644 --- a/src/users.c +++ b/src/users.c @@ -51,9 +51,8 @@ userid_compare (const void *v_a, const void *v_b) } static void -list_entries_users (int n) +list_entries_users (int n, const STRUCT_UTMP *this) { - register STRUCT_UTMP *this = utmp_contents; char **u; int i; int n_entries; @@ -66,7 +65,7 @@ list_entries_users (int n) #ifdef USER_PROCESS && this->ut_type == USER_PROCESS #endif - ) + ) { char *trimmed_name; @@ -98,8 +97,14 @@ list_entries_users (int n) static void users (const char *filename) { - int n_users = read_utmp (filename); - list_entries_users (n_users); + int n_users; + STRUCT_UTMP *utmp_buf; + int fail = read_utmp (filename, &n_users, &utmp_buf); + + if (fail) + error (1, errno, "%s", filename); + + list_entries_users (n_users, utmp_buf); } static void |