diff options
Diffstat (limited to 'coreutils/who.c')
-rw-r--r-- | coreutils/who.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/who.c b/coreutils/who.c index f955ce6d3..8337212c9 100644 --- a/coreutils/who.c +++ b/coreutils/who.c | |||
@@ -73,7 +73,7 @@ static void idle_string(char *str6, time_t t) | |||
73 | int who_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 73 | int who_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
74 | int who_main(int argc UNUSED_PARAM, char **argv) | 74 | int who_main(int argc UNUSED_PARAM, char **argv) |
75 | { | 75 | { |
76 | struct utmp *ut; | 76 | struct utmpx *ut; |
77 | unsigned opt; | 77 | unsigned opt; |
78 | int do_users = (ENABLE_USERS && (!ENABLE_WHO || applet_name[0] == 'u')); | 78 | int do_users = (ENABLE_USERS && (!ENABLE_WHO || applet_name[0] == 'u')); |
79 | const char *fmt = "%s"; | 79 | const char *fmt = "%s"; |
@@ -83,8 +83,8 @@ int who_main(int argc UNUSED_PARAM, char **argv) | |||
83 | if (opt & 2) // -H | 83 | if (opt & 2) // -H |
84 | printf("USER\t\tTTY\t\tIDLE\tTIME\t\t HOST\n"); | 84 | printf("USER\t\tTTY\t\tIDLE\tTIME\t\t HOST\n"); |
85 | 85 | ||
86 | setutent(); | 86 | setutxent(); |
87 | while ((ut = getutent()) != NULL) { | 87 | while ((ut = getutxent()) != NULL) { |
88 | if (ut->ut_user[0] | 88 | if (ut->ut_user[0] |
89 | && ((opt & 1) || ut->ut_type == USER_PROCESS) | 89 | && ((opt & 1) || ut->ut_type == USER_PROCESS) |
90 | ) { | 90 | ) { |
@@ -126,6 +126,6 @@ int who_main(int argc UNUSED_PARAM, char **argv) | |||
126 | if (do_users) | 126 | if (do_users) |
127 | bb_putchar('\n'); | 127 | bb_putchar('\n'); |
128 | if (ENABLE_FEATURE_CLEAN_UP) | 128 | if (ENABLE_FEATURE_CLEAN_UP) |
129 | endutent(); | 129 | endutxent(); |
130 | return EXIT_SUCCESS; | 130 | return EXIT_SUCCESS; |
131 | } | 131 | } |