summaryrefslogtreecommitdiffstats
path: root/usr.bin/last/last.c
diff options
context:
space:
mode:
authorhrs <hrs@FreeBSD.org>2012-01-22 11:34:24 +0000
committerhrs <hrs@FreeBSD.org>2012-01-22 11:34:24 +0000
commit1736506e921043ab3bc71f65d90cc82aa777717e (patch)
treef0705b645599d06d72b5afa14012287fd20e4ff9 /usr.bin/last/last.c
parent983cddf8a649edca44dbee0a310b2ef2f220967d (diff)
downloadFreeBSD-src-1736506e921043ab3bc71f65d90cc82aa777717e.zip
FreeBSD-src-1736506e921043ab3bc71f65d90cc82aa777717e.tar.gz
- Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp.
- A real filename is now shown in an output report when "-f file" is specified. - Add Xr lastlogin into last(1) manual page. Reviewed by: ed MFC after: 1 week
Diffstat (limited to 'usr.bin/last/last.c')
-rw-r--r--usr.bin/last/last.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/last/last.c b/usr.bin/last/last.c
index 3ac744e..e587def 100644
--- a/usr.bin/last/last.c
+++ b/usr.bin/last/last.c
@@ -83,7 +83,7 @@ struct idtab {
static const char *crmsg; /* cause of last reboot */
static time_t currentout; /* current logout value */
static long maxrec; /* records to display */
-static const char *file = NULL; /* wtmp file */
+static const char *file = NULL; /* utx.log file */
static int sflag = 0; /* show delta in seconds */
static int width = 5; /* show seconds in delta */
static int yflag; /* show year */
@@ -194,7 +194,7 @@ main(int argc, char *argv[])
/*
* wtmp --
- * read through the wtmp file
+ * read through the utx.log file
*/
static void
wtmp(void)
@@ -229,13 +229,13 @@ wtmp(void)
doentry(&buf[--amount]);
tm = localtime(&t);
- (void) strftime(ct, sizeof(ct), "\nwtmp begins %+\n", tm);
- printf("%s", ct);
+ (void) strftime(ct, sizeof(ct), "%+", tm);
+ printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct);
}
/*
* doentry --
- * process a single wtmp entry
+ * process a single utx.log entry
*/
static void
doentry(struct utmpx *bp)
OpenPOWER on IntegriCloud