summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-12-05 19:54:37 +0000
committered <ed@FreeBSD.org>2009-12-05 19:54:37 +0000
commit273027375e4d64770587fd64a7702736353c2848 (patch)
tree5e714b93475e7b8616784687e86c44c57c7c511c /usr.bin
parentd48cd1eb37cbd6f11ed810eb81d29ae10112e472 (diff)
downloadFreeBSD-src-273027375e4d64770587fd64a7702736353c2848.zip
FreeBSD-src-273027375e4d64770587fd64a7702736353c2848.tar.gz
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.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/users/users.c9
1 files changed, 5 insertions, 4 deletions
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 <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]);
OpenPOWER on IntegriCloud