From 9690ea4717220c8d57c7ebe10dd3e2512ccc5651 Mon Sep 17 00:00:00 2001 From: phk Date: Thu, 11 May 2006 17:25:36 +0000 Subject: Use sysctlbyname --- usr.bin/w/w.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'usr.bin/w') 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 */ -- cgit v1.1