summaryrefslogtreecommitdiffstats
path: root/usr.bin/w
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2006-05-11 17:25:36 +0000
committerphk <phk@FreeBSD.org>2006-05-11 17:25:36 +0000
commit9690ea4717220c8d57c7ebe10dd3e2512ccc5651 (patch)
tree4464b08bb18f36347025c39842401046277bc2f3 /usr.bin/w
parent8777f94272f15ec04b33f002b60af8895ace75ae (diff)
downloadFreeBSD-src-9690ea4717220c8d57c7ebe10dd3e2512ccc5651.zip
FreeBSD-src-9690ea4717220c8d57c7ebe10dd3e2512ccc5651.tar.gz
Use sysctlbyname
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 8f69ab6..379e6a4 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 */
OpenPOWER on IntegriCloud