Date: Sun, 10 Jan 2010 21:59:06 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r202049 - head/usr.bin/lastcomm Message-ID: <201001102159.o0ALx6EH052799@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sun Jan 10 21:59:06 2010 New Revision: 202049 URL: http://svn.freebsd.org/changeset/base/202049 Log: Let lastcomm(1) build without <utmp.h>. Use MAXLOGNAME - 1 instead of UTNAMESIZE. There is no definition for TTY name sizes, at least not as low as 8, so hardcode it for now. Modified: head/usr.bin/lastcomm/lastcomm.c Modified: head/usr.bin/lastcomm/lastcomm.c ============================================================================== --- head/usr.bin/lastcomm/lastcomm.c Sun Jan 10 21:41:37 2010 (r202048) +++ head/usr.bin/lastcomm/lastcomm.c Sun Jan 10 21:59:06 2010 (r202049) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <utmp.h> #include "pathnames.h" /*XXX*/#include <inttypes.h> @@ -154,11 +153,11 @@ main(int argc, char *argv[]) if (*argv && !requested(argv, &ab)) continue; - (void)printf("%-*.*s %-7s %-*s %-*s", + (void)printf("%-*.*s %-7s %-*s %-8s", AC_COMM_LEN, AC_COMM_LEN, ab.ac_comm, flagbits(ab.ac_flagx), - UT_NAMESIZE, user_from_uid(ab.ac_uid, 0), - UT_LINESIZE, getdev(ab.ac_tty)); + MAXLOGNAME - 1, user_from_uid(ab.ac_uid, 0), + getdev(ab.ac_tty)); /* user + system time */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001102159.o0ALx6EH052799>