From owner-svn-src-head@FreeBSD.ORG Sun Jan 22 11:34:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E1C3106566B; Sun, 22 Jan 2012 11:34:24 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 632D98FC13; Sun, 22 Jan 2012 11:34:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MBYOow074169; Sun, 22 Jan 2012 11:34:24 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MBYOho074166; Sun, 22 Jan 2012 11:34:24 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201221134.q0MBYOho074166@svn.freebsd.org> From: Hiroki Sato Date: Sun, 22 Jan 2012 11:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230458 - head/usr.bin/last X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:34:24 -0000 Author: hrs Date: Sun Jan 22 11:34:24 2012 New Revision: 230458 URL: http://svn.freebsd.org/changeset/base/230458 Log: - 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 Modified: head/usr.bin/last/last.1 head/usr.bin/last/last.c Modified: head/usr.bin/last/last.1 ============================================================================== --- head/usr.bin/last/last.1 Sun Jan 22 11:20:42 2012 (r230457) +++ head/usr.bin/last/last.1 Sun Jan 22 11:34:24 2012 (r230458) @@ -198,6 +198,7 @@ login data base .El .Sh SEE ALSO .Xr lastcomm 1 , +.Xr lastlogin 8 , .Xr getutxent 3 , .Xr ac 8 .Sh HISTORY Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Sun Jan 22 11:20:42 2012 (r230457) +++ head/usr.bin/last/last.c Sun Jan 22 11:34:24 2012 (r230458) @@ -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)