From owner-svn-src-user@FreeBSD.ORG Sun Jan 10 18:09:33 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEFD8106566C; Sun, 10 Jan 2010 18:09:33 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D072D8FC15; Sun, 10 Jan 2010 18:09:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o0AI9X8e001093; Sun, 10 Jan 2010 18:09:33 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o0AI9Xjt001091; Sun, 10 Jan 2010 18:09:33 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201001101809.o0AI9Xjt001091@svn.freebsd.org> From: Ed Schouten Date: Sun, 10 Jan 2010 18:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r202022 - user/ed/utmpx/usr.bin/last X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Jan 2010 18:09:34 -0000 Author: ed Date: Sun Jan 10 18:09:33 2010 New Revision: 202022 URL: http://svn.freebsd.org/changeset/base/202022 Log: Seems there was still something missing. We now need to print custom strings for entries that have nothing to do with logins/logouts. Modified: user/ed/utmpx/usr.bin/last/last.c Modified: user/ed/utmpx/usr.bin/last/last.c ============================================================================== --- user/ed/utmpx/usr.bin/last/last.c Sun Jan 10 18:00:45 2010 (r202021) +++ user/ed/utmpx/usr.bin/last/last.c Sun Jan 10 18:09:33 2010 (r202022) @@ -333,9 +333,25 @@ printentry(struct utmpx *bp, struct idta (void) strftime(ct, sizeof(ct), d_first ? (yflag ? "%a %e %b %Y %R" : "%a %e %b %R") : (yflag ? "%a %b %e %Y %R" : "%a %b %e %R"), tm); - printf("%-10s %-8s %-24.24s %s%c", - bp->ut_user, bp->ut_line, bp->ut_host, - ct, tt == NULL ? '\n' : ' '); + switch (bp->ut_type) { + case BOOT_TIME: + printf("%-44s", "boot time"); + break; + case SHUTDOWN_TIME: + printf("%-44s", "shutdown time"); + break; + case OLD_TIME: + printf("%-44s", "old time"); + break; + case NEW_TIME: + printf("%-44s", "new time"); + break; + case USER_PROCESS: + printf("%-10s %-8s %-24.24s", + bp->ut_user, bp->ut_line, bp->ut_host); + break; + } + printf(" %s%c", ct, tt == NULL ? '\n' : ' '); if (tt == NULL) return; if (!tt->logout) {