From owner-svn-src-head@FreeBSD.ORG Sat Dec 5 19:54:37 2009 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 76FA51065696; Sat, 5 Dec 2009 19:54:37 +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 6657A8FC1B; Sat, 5 Dec 2009 19:54:37 +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 nB5Jsbpl098108; Sat, 5 Dec 2009 19:54:37 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB5JsbS5098106; Sat, 5 Dec 2009 19:54:37 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912051954.nB5JsbS5098106@svn.freebsd.org> From: Ed Schouten Date: Sat, 5 Dec 2009 19:54:37 +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: r200154 - head/usr.bin/users 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: Sat, 05 Dec 2009 19:54:37 -0000 Author: ed Date: Sat Dec 5 19:54:37 2009 New Revision: 200154 URL: http://svn.freebsd.org/changeset/base/200154 Log: Use _ULOG_POSIX_NAMES here, to make eventual porting to easier. By the time we gain a real , it's just a matter of changing the include at the top and -lulog from the Makefile. Modified: head/usr.bin/users/users.c Modified: head/usr.bin/users/users.c ============================================================================== --- head/usr.bin/users/users.c Sat Dec 5 19:53:29 2009 (r200153) +++ head/usr.bin/users/users.c Sat Dec 5 19:54:37 2009 (r200154) @@ -51,6 +51,7 @@ static const char rcsid[] = #include #include #include +#define _ULOG_POSIX_NAMES #include #include @@ -66,7 +67,7 @@ main(int argc, char **argv) int ncnt = 0; int nmax = 0; int cnt; - struct ulog_utmpx *ut; + struct utmpx *ut; int ch; while ((ch = getopt(argc, argv, "")) != -1) @@ -78,8 +79,8 @@ main(int argc, char **argv) argc -= optind; argv += optind; - ulog_setutxent(); - while ((ut = ulog_getutxent()) != NULL) { + setutxent(); + while ((ut = getutxent()) != NULL) { if (ut->ut_type != USER_PROCESS) continue; if (ncnt >= nmax) { @@ -93,7 +94,7 @@ main(int argc, char **argv) (void)strlcpy(names[ncnt], ut->ut_user, sizeof(*names)); ++ncnt; } - ulog_endutxent(); + endutxent(); if (ncnt > 0) { qsort(names, ncnt, sizeof(namebuf), scmp); (void)printf("%s", names[0]);