diff options
author | Jim Meyering <jim@meyering.net> | 1997-07-13 03:56:29 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-07-13 03:56:29 +0000 |
commit | 393e4a8c36a42e172b4bea8d5e22e02bb05cbdce (patch) | |
tree | c782656b97211c1136453dedc9b1f275263707fd /src | |
parent | aba02b5978b5902fb8fdad11770cfc957e3c0fea (diff) | |
download | coreutils-393e4a8c36a42e172b4bea8d5e22e02bb05cbdce.tar.xz |
(uptime): Update read_utmp caller.
Diffstat (limited to 'src')
-rw-r--r-- | src/uptime.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/uptime.c b/src/uptime.c index ec7c3886d..b2e7cb6cd 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -41,9 +41,8 @@ static struct option const longopts[] = }; static void -print_uptime (int n) +print_uptime (int n, const STRUCT_UTMP *this) { - register STRUCT_UTMP *this = utmp_contents; register int entries = 0; time_t boot_time = 0; time_t time_now; @@ -143,8 +142,14 @@ print_uptime (int n) static void uptime (const char *filename) { - int n_users = read_utmp (filename); - print_uptime (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); + + print_uptime (n_users, utmp_buf); } static void |