svn commit: r202194 - head/sbin/init
Ed Schouten
ed at FreeBSD.org
Wed Jan 13 17:58:50 UTC 2010
Author: ed
Date: Wed Jan 13 17:58:49 2010
New Revision: 202194
URL: http://svn.freebsd.org/changeset/base/202194
Log:
Migrate init(8) towards utmpx.
According to a comment, we cannot safely remove utmpx entries here
anymore. This is because the libc routines may block on file locking. In
an ideal world login(1) should just remove the entries, which is why I'm
disabling this code for now. If it turns out we get lots of stale
entries here, we should figure out a way to deal with that.
Modified:
head/sbin/init/Makefile
head/sbin/init/init.c
Modified: head/sbin/init/Makefile
==============================================================================
--- head/sbin/init/Makefile Wed Jan 13 17:56:54 2010 (r202193)
+++ head/sbin/init/Makefile Wed Jan 13 17:58:49 2010 (r202194)
@@ -6,8 +6,8 @@ MAN= init.8
PRECIOUSPROG=
INSTALLFLAGS=-b -B.bak
CFLAGS+=-DDEBUGSHELL -DSECURE -DLOGIN_CAP -DCOMPAT_SYSV_INIT
-DPADD= ${LIBUTIL} ${LIBULOG} ${LIBCRYPT}
-LDADD= -lutil -lulog -lcrypt
+DPADD= ${LIBUTIL} ${LIBCRYPT}
+LDADD= -lutil -lcrypt
NO_SHARED?= YES
Modified: head/sbin/init/init.c
==============================================================================
--- head/sbin/init/init.c Wed Jan 13 17:56:54 2010 (r202193)
+++ head/sbin/init/init.c Wed Jan 13 17:58:49 2010 (r202194)
@@ -65,9 +65,9 @@ static const char rcsid[] =
#include <syslog.h>
#include <time.h>
#include <ttyent.h>
-#define _ULOG_POSIX_NAMES
#include <ulog.h>
#include <unistd.h>
+#include <utmpx.h>
#include <sys/reboot.h>
#include <err.h>
@@ -569,10 +569,13 @@ transition(state_t s)
* NB: should send a message to the session logger to avoid blocking.
*/
static void
-clear_session_logs(session_t *sp)
+clear_session_logs(session_t *sp __unused)
{
- ulog_logout(sp->se_device);
+ /*
+ * XXX: Use getutxline() and call pututxline() for each entry.
+ * Is this safe to do this here? Is it really required anyway?
+ */
}
/*
More information about the svn-src-head
mailing list