Date: Sat, 5 Dec 2009 19:54:37 +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: r200154 - head/usr.bin/users Message-ID: <200912051954.nB5JsbS5098106@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <utmpx.h> easier. By the time we gain a real <utmpx.h>, 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 <stdio.h> #include <stdlib.h> #include <string.h> +#define _ULOG_POSIX_NAMES #include <ulog.h> #include <unistd.h> @@ -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]);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912051954.nB5JsbS5098106>