From 1fded7e6240e43281379cb8abd4569ce41e5dabe Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 13 Jan 2010 17:50:58 +0000 Subject: Migrate finger(1) towards utmpx. It was already ported to use libulog, which makes it simpler now. Be sure to catch the error returned by setutxdb(). Otherwise it may perform a lookup on the utx.active database. --- usr.bin/finger/Makefile | 3 --- usr.bin/finger/finger.c | 3 +-- usr.bin/finger/lprint.c | 3 +-- usr.bin/finger/net.c | 3 +-- usr.bin/finger/sprint.c | 3 +-- usr.bin/finger/util.c | 11 +++++------ 6 files changed, 9 insertions(+), 17 deletions(-) (limited to 'usr.bin/finger') diff --git a/usr.bin/finger/Makefile b/usr.bin/finger/Makefile index a7db063..30e04df 100644 --- a/usr.bin/finger/Makefile +++ b/usr.bin/finger/Makefile @@ -7,7 +7,4 @@ MAN= finger.1 finger.conf.5 WARNS?= 2 -DPADD= ${LIBULOG} -LDADD= -lulog - .include diff --git a/usr.bin/finger/finger.c b/usr.bin/finger/finger.c index 88b39fa..ae2766f 100644 --- a/usr.bin/finger/finger.c +++ b/usr.bin/finger/finger.c @@ -82,9 +82,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include #include "finger.h" diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c index c473c7f..628aab6 100644 --- a/usr.bin/finger/lprint.c +++ b/usr.bin/finger/lprint.c @@ -56,9 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "finger.h" #include "pathnames.h" diff --git a/usr.bin/finger/net.c b/usr.bin/finger/net.c index dfc533a..14a69c9 100644 --- a/usr.bin/finger/net.c +++ b/usr.bin/finger/net.c @@ -54,9 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "finger.h" static void cleanup(int sig); diff --git a/usr.bin/finger/sprint.c b/usr.bin/finger/sprint.c index c08ca3a..d4091a8 100644 --- a/usr.bin/finger/sprint.c +++ b/usr.bin/finger/sprint.c @@ -53,8 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include +#include #include "finger.h" static void stimeprint(WHERE *); diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c index 8ee0825..8e3812b 100644 --- a/usr.bin/finger/util.c +++ b/usr.bin/finger/util.c @@ -56,9 +56,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define _ULOG_POSIX_NAMES -#include #include +#include #include "finger.h" #include "pathnames.h" @@ -110,11 +109,11 @@ void enter_lastlog(PERSON *pn) { WHERE *w; - struct ulog_utmpx *ut; + struct utmpx *ut = NULL; char doit = 0; - ulog_setutxfile(UTXI_USER, NULL); - ut = ulog_getutxuser(pn->name); + if (setutxdb(UTXDB_LASTLOGIN, NULL) == 0) + ut = getutxuser(pn->name); if ((w = pn->whead) == NULL) doit = 1; else if (ut != NULL && ut->ut_type == USER_PROCESS) { @@ -140,7 +139,7 @@ enter_lastlog(PERSON *pn) strcpy(w->host, ut->ut_host); w->loginat = ut->ut_tv.tv_sec; } - ulog_endutxent(); + endutxent(); } void -- cgit v1.1