From 273027375e4d64770587fd64a7702736353c2848 Mon Sep 17 00:00:00 2001 From: ed Date: Sat, 5 Dec 2009 19:54:37 +0000 Subject: 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. --- usr.bin/users/users.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/users/users.c b/usr.bin/users/users.c index 66e1da9..8000c03 100644 --- a/usr.bin/users/users.c +++ b/usr.bin/users/users.c @@ -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]); -- cgit v1.1