From cfe41e3b689836021ab109c62db209c527d5b01f Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Sat, 5 Dec 2009 19:54:37 +0000 Subject: [PATCH] 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(-) diff --git a/usr.bin/users/users.c b/usr.bin/users/users.c index 66e1da9062a7..8000c03064aa 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]);