diff options
| author | David Greenman <dg@FreeBSD.org> | 1995-08-28 11:27:34 +0000 |
|---|---|---|
| committer | David Greenman <dg@FreeBSD.org> | 1995-08-28 11:27:34 +0000 |
| commit | 20947268fd64464df28abc338dd3f2887fc06703 (patch) | |
| tree | 3561251bb91498d314debddd9e2da49de08c3985 /usr.bin | |
| parent | a269dff5f16bbc62846009a9734259e88d37b459 (diff) | |
Notes
Diffstat (limited to 'usr.bin')
| -rw-r--r-- | usr.bin/who/who.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c index d1e6eb92f212b..77a131cb03757 100644 --- a/usr.bin/who/who.c +++ b/usr.bin/who/who.c @@ -46,7 +46,7 @@ static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93"; #include <sys/types.h> #include <sys/file.h> -#include <sys/time.h> +#include <time.h> #include <pwd.h> #include <utmp.h> #include <stdio.h> @@ -60,7 +60,6 @@ main(argc, argv) struct passwd *pw; FILE *ufp, *file(); char *t, *rindex(), *strcpy(), *strncpy(), *ttyname(); - time_t time(); switch (argc) { case 1: /* who */ @@ -109,11 +108,12 @@ main(argc, argv) output(up) struct utmp *up; { - char *ctime(); + char buf[80]; (void)printf("%-*.*s %-*.*s", UT_NAMESIZE, UT_NAMESIZE, up->ut_name, UT_LINESIZE, UT_LINESIZE, up->ut_line); - (void)printf("%.12s", ctime(&up->ut_time) + 4); + (void)strftime(buf, sizeof(buf), "%c", localtime(&up->ut_time)); + (void)printf("%.12s", buf + 4); if (*up->ut_host) printf("\t(%.*s)", UT_HOSTSIZE, up->ut_host); (void)putchar('\n'); |
