aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/w
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2006-05-11 17:25:36 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2006-05-11 17:25:36 +0000
commitbec1fa860710034abcd387594ac091497608cb7e (patch)
tree4464b08bb18f36347025c39842401046277bc2f3 /usr.bin/w
parent31048bda0e41f34ad22cee98390ded00faccc80b (diff)
downloadsrc-bec1fa860710034abcd387594ac091497608cb7e.tar.gz
src-bec1fa860710034abcd387594ac091497608cb7e.zip
Use sysctlbyname
Notes
Notes: svn path=/head/; revision=158444
Diffstat (limited to 'usr.bin/w')
-rw-r--r--usr.bin/w/w.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 8f69ab678563..379e6a43854d 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -239,21 +239,16 @@ main(int argc, char *argv[])
nextp = &ep->next;
memmove(&ep->utmp, &utmp, sizeof(struct utmp));
ep->tdev = stp->st_rdev;
-#ifdef CPU_CONSDEV
/*
* If this is the console device, attempt to ascertain
* the true console device dev_t.
*/
if (ep->tdev == 0) {
- int mib[2];
size_t size;
- mib[0] = CTL_MACHDEP;
- mib[1] = CPU_CONSDEV;
size = sizeof(dev_t);
- (void)sysctl(mib, 2, &ep->tdev, &size, NULL, 0);
+ (void)sysctlbyname("machdep.consdev", &ep->tdev, &size, NULL, 0);
}
-#endif
touched = stp->st_atime;
if (touched < ep->utmp.ut_time) {
/* tty untouched since before login */