version 1.11, 2001/01/31 20:12:49 |
version 1.12, 2001/02/17 17:35:14 |
|
|
static char rcsid[] = "$OpenBSD$"; |
static char rcsid[] = "$OpenBSD$"; |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
#include <sys/types.h> |
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/file.h> |
#include <sys/file.h> |
#include <dirent.h> |
#include <dirent.h> |
|
|
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <time.h> |
#include <utmp.h> |
#include <utmp.h> |
#include <vis.h> |
#include <vis.h> |
#include <err.h> |
#include <err.h> |
|
|
*/ |
*/ |
#define down(w,now) ((now) - (w)->wd_recvtime > 11 * 60) |
#define down(w,now) ((now) - (w)->wd_recvtime > 11 * 60) |
|
|
char *ctime(); |
|
time_t now; |
time_t now; |
int aflg; |
int aflg; |
|
|
|
|
register struct whoent *we; |
register struct whoent *we; |
register struct myutmp *mp; |
register struct myutmp *mp; |
int f, n, i; |
int f, n, i; |
time_t time(); |
|
int nhosts = 0; |
int nhosts = 0; |
|
|
while ((ch = getopt(argc, argv, "a")) != -1) |
while ((ch = getopt(argc, argv, "a")) != -1) |
|
|
we++; |
we++; |
continue; |
continue; |
} |
} |
if (nusers >= NUSERS) { |
if (nusers >= NUSERS) |
printf("too many users\n"); |
errx(1, "too many users"); |
exit(1); |
|
} |
|
mp->myutmp = we->we_utmp; mp->myidle = we->we_idle; |
mp->myutmp = we->we_utmp; mp->myidle = we->we_idle; |
(void) strncpy(mp->myhost, w->wd_hostname, |
(void) strncpy(mp->myhost, w->wd_hostname, |
sizeof(mp->myhost)-1); |
sizeof(mp->myhost)-1); |
|
|
strvis(vis_user, mp->myutmp.out_name, VIS_CSTYLE); |
strvis(vis_user, mp->myutmp.out_name, VIS_CSTYLE); |
printf("%-*.*s %-*s %.12s", |
printf("%-*.*s %-*s %.12s", |
UT_NAMESIZE, UT_NAMESIZE, vis_user, |
UT_NAMESIZE, UT_NAMESIZE, vis_user, |
width, |
width, buf, |
buf, |
|
ctime((time_t *)&mp->myutmp.out_time)+4); |
ctime((time_t *)&mp->myutmp.out_time)+4); |
mp->myidle /= 60; |
mp->myidle /= 60; |
if (mp->myidle) { |
if (mp->myidle) { |