diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-07-28 10:14:01 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2011-07-28 10:14:01 +0000 |
commit | 27783a6bc1030df919c99bb960f2e1f38f456ea4 (patch) | |
tree | f043d56e2f7e03166c36403db567e655968f0615 /usr.bin/w | |
parent | 21335da42931d5bcf6b52268cf095d21fa5f023f (diff) |
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@
Diffstat (limited to 'usr.bin/w')
-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; } |