diff options
author | 2011-07-28 10:14:00 +0000 | |
---|---|---|
committer | 2011-07-28 10:14:00 +0000 | |
commit | 41763857a7de9fbdab7bd98c9617bc38e866abe8 (patch) | |
tree | c287f8418fe0362a3b2b914e74897b03cffc9f18 | |
parent | Beagle will not need the hack to rdsetroot va != pa kernels like is (diff) | |
download | wireguard-openbsd-41763857a7de9fbdab7bd98c9617bc38e866abe8.tar.xz wireguard-openbsd-41763857a7de9fbdab7bd98c9617bc38e866abe8.zip |
Adjust for machdep.consdev -> kern.consdev sysctl change. This should restore
the functionality to figure out the real console device when /dev/console is
used.
ok millert@, deraadt@
-rw-r--r-- | usr.bin/w/w.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index b65500f0268..7213d565204 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -1,4 +1,4 @@ -/* $OpenBSD: w.c,v 1.49 2011/04/26 07:29:05 jasper Exp $ */ +/* $OpenBSD: w.c,v 1.50 2011/07/28 10:14:00 kettenis Exp $ */ /*- * Copyright (c) 1980, 1991, 1993, 1994 @@ -188,7 +188,7 @@ main(int argc, char *argv[]) if (!(stp = ttystat(ep->utmp.ut_line))) continue; ep->tdev = stp->st_rdev; -#ifdef CPU_CONSDEV + /* * If this is the console device, attempt to ascertain * the true console device dev_t. @@ -197,12 +197,12 @@ main(int argc, char *argv[]) int mib[2]; size_t size; - mib[0] = CTL_MACHDEP; - mib[1] = CPU_CONSDEV; + mib[0] = CTL_KERN; + mib[1] = KERN_CONSDEV; size = sizeof(dev_t); (void) sysctl(mib, 2, &ep->tdev, &size, NULL, 0); } -#endif + if ((ep->idle = now - stp->st_atime) < 0) ep->idle = 0; } |