diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-16 05:24:43 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-16 05:24:43 +0000 |
commit | 01cd9570c7e51e0e1e472f965d9f774c761a8521 (patch) | |
tree | 9dec9b7a6251de5ccfe325773e40fdccb6f365de /coreutils | |
parent | a6899c35870d93f44630c4307eb938a1ba4d4abb (diff) | |
download | busybox-w32-01cd9570c7e51e0e1e472f965d9f774c761a8521.tar.gz busybox-w32-01cd9570c7e51e0e1e472f965d9f774c761a8521.tar.bz2 busybox-w32-01cd9570c7e51e0e1e472f965d9f774c761a8521.zip |
who: add -a (by Tito)
Diffstat (limited to 'coreutils')
-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 725974425..f336c953c 100644 --- a/coreutils/who.c +++ b/coreutils/who.c | |||
@@ -46,15 +46,15 @@ int who_main(int argc, char **argv) | |||
46 | struct utmp *ut; | 46 | struct utmp *ut; |
47 | struct stat st; | 47 | struct stat st; |
48 | char *name; | 48 | char *name; |
49 | unsigned opt; | ||
49 | 50 | ||
50 | if (argc > 1) { | 51 | opt_complementary = "=0"; |
51 | bb_show_usage(); | 52 | opt = getopt32(argv, "a"); |
52 | } | ||
53 | 53 | ||
54 | setutent(); | 54 | setutent(); |
55 | printf("USER TTY IDLE TIME HOST\n"); | 55 | printf("USER TTY IDLE TIME HOST\n"); |
56 | while ((ut = getutent()) != NULL) { | 56 | while ((ut = getutent()) != NULL) { |
57 | if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) { | 57 | if (ut->ut_user[0] && (opt || ut->ut_type == USER_PROCESS)) { |
58 | /* ut->ut_line is device name of tty - "/dev/" */ | 58 | /* ut->ut_line is device name of tty - "/dev/" */ |
59 | name = concat_path_file("/dev", ut->ut_line); | 59 | name = concat_path_file("/dev", ut->ut_line); |
60 | str6[0] = '?'; | 60 | str6[0] = '?'; |