aboutsummaryrefslogtreecommitdiff
path: root/toys/w.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-08-25 14:25:22 -0500
committerRob Landley <rob@landley.net>2012-08-25 14:25:22 -0500
commit3a9241add947cb6d24b5de7a8927517426a78795 (patch)
treed122ab6570439cd6b17c7d73ed8d4e085e0b8a95 /toys/w.c
parent689f095bc976417bf50810fe59a3b3ac32b21105 (diff)
downloadtoybox-3a9241add947cb6d24b5de7a8927517426a78795.tar.gz
Move commands into "posix", "lsb", and "other" menus/directories.
Diffstat (limited to 'toys/w.c')
-rw-r--r--toys/w.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/toys/w.c b/toys/w.c
deleted file mode 100644
index 50f2283b..00000000
--- a/toys/w.c
+++ /dev/null
@@ -1,36 +0,0 @@
-/* vi: set sw=4 ts=4:
- *
- * w.c - shows logged in users
- *
- * Copyright 2012 Gaurang Shastri <gmshastri@gmail.com>
- *
- * Not in SUSv4.
-
-USE_W(NEWTOY(w, NULL, TOYFLAG_USR|TOYFLAG_BIN))
-
-config W
- bool "w"
- default y
- help
- usage: w
-
- Show who is logged on and since how long they logged in.
-*/
-
-#include "toys.h"
-
-void w_main(void)
-{
- struct utmpx *x;
-
- xprintf("USER TTY LOGIN@ FROM");
- setutxent();
- while ((x=getutxent()) != NULL)
- if (x->ut_type==7) {
- time_t tt = x->ut_tv.tv_sec;
-
- xprintf("\n%-9.8s%-9.8s %-4.24s (%-1.12s)", x->ut_user, x->ut_line,
- ctime(&tt), x->ut_host);
- }
- xputc('\n');
-}