summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko2007-11-16 05:24:43 +0000
committerDenis Vlasenko2007-11-16 05:24:43 +0000
commit01cd9570c7e51e0e1e472f965d9f774c761a8521 (patch)
tree9dec9b7a6251de5ccfe325773e40fdccb6f365de /coreutils
parenta6899c35870d93f44630c4307eb938a1ba4d4abb (diff)
downloadbusybox-01cd9570c7e51e0e1e472f965d9f774c761a8521.zip
busybox-01cd9570c7e51e0e1e472f965d9f774c761a8521.tar.gz
who: add -a (by Tito)
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/who.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/coreutils/who.c b/coreutils/who.c
index 7259744..f336c95 100644
--- a/coreutils/who.c
+++ b/coreutils/who.c
@@ -46,15 +46,15 @@ int who_main(int argc, char **argv)
struct utmp *ut;
struct stat st;
char *name;
+ unsigned opt;
- if (argc > 1) {
- bb_show_usage();
- }
+ opt_complementary = "=0";
+ opt = getopt32(argv, "a");
setutent();
printf("USER TTY IDLE TIME HOST\n");
while ((ut = getutent()) != NULL) {
- if (ut->ut_user[0] && ut->ut_type == USER_PROCESS) {
+ if (ut->ut_user[0] && (opt || ut->ut_type == USER_PROCESS)) {
/* ut->ut_line is device name of tty - "/dev/" */
name = concat_path_file("/dev", ut->ut_line);
str6[0] = '?';