Support wtmpx.

This commit is contained in:
wiz 2002-08-02 15:05:57 +00:00
parent d9deaad608
commit 42ec3bd114
2 changed files with 9 additions and 3 deletions

View File

@ -1,9 +1,10 @@
# $NetBSD: Makefile,v 1.17 2000/04/25 14:03:26 hubertf Exp $
# $NetBSD: Makefile,v 1.18 2002/08/02 15:05:57 wiz Exp $
# @(#)Makefile 8.1 (Berkeley) 6/5/93
PROG= reboot
DPADD= ${LIBUTIL}
LDADD= -lutil
CPPFLAGS+= -DSUPPORT_UTMP -DSUPPORT_UTMPX
MAN= reboot.8
MLINKS= reboot.8 halt.8 \
reboot.8 poweroff.8

View File

@ -1,4 +1,4 @@
/* $NetBSD: reboot.c,v 1.30 2002/08/02 14:59:40 wiz Exp $ */
/* $NetBSD: reboot.c,v 1.31 2002/08/02 15:05:58 wiz Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -44,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 1986, 1993\n"
#if 0
static char sccsid[] = "@(#)reboot.c 8.1 (Berkeley) 6/5/93";
#else
__RCSID("$NetBSD: reboot.c,v 1.30 2002/08/02 14:59:40 wiz Exp $");
__RCSID("$NetBSD: reboot.c,v 1.31 2002/08/02 15:05:58 wiz Exp $");
#endif
#endif /* not lint */
@ -157,7 +157,12 @@ main(int argc, char *argv[])
syslog(LOG_CRIT, "rebooted by %s", user);
}
}
#ifdef SUPPORT_UTMP
logwtmp("~", "shutdown", "");
#endif
#ifdef SUPPORT_UTMPX
logwtmpx("~", "shutdown", "", INIT_PROCESS, 0);
#endif
/*
* Do a sync early on, so disks start transfers while we're off