aboutsummaryrefslogtreecommitdiff
path: root/procps/uptime.c
diff options
context:
space:
mode:
Diffstat (limited to 'procps/uptime.c')
-rw-r--r--procps/uptime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/procps/uptime.c b/procps/uptime.c
index 778812a6f..149bae6e5 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -81,10 +81,10 @@ int uptime_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
#if ENABLE_FEATURE_UPTIME_UTMP_SUPPORT
{
- struct utmp *ut;
+ struct utmpx *ut;
unsigned users = 0;
- while ((ut = getutent()) != NULL) {
- if ((ut->ut_type == USER_PROCESS) && (ut->ut_name[0] != '\0'))
+ while ((ut = getutxent()) != NULL) {
+ if ((ut->ut_type == USER_PROCESS) && (ut->ut_user[0] != '\0'))
users++;
}
printf(", %u users", users);