diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-02-10 03:52:54 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-02-10 03:52:54 +0000 |
commit | 79fbc045669f600ca8934f6d680040c507360fc6 (patch) | |
tree | 72d8f40e8bcbe918bdee8be44f8ac3e60f08b923 /sbin/sysctl | |
parent | cfb2b23f4d1c7a935472f5cc81f845e91bccf991 (diff) |
Tell user to run pstat -t to get kern.tty.ttyinfo if they explicitly
ask for it, else just ignore it. This is consistent with sysctl
behavior and other entries of type CTLTYPE_STRUCT.
Diffstat (limited to 'sbin/sysctl')
-rw-r--r-- | sbin/sysctl/sysctl.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 4095b654aa1..283bc1e6886 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sysctl.c,v 1.107 2004/02/10 01:20:12 millert Exp $ */ +/* $OpenBSD: sysctl.c,v 1.108 2004/02/10 03:52:53 millert Exp $ */ /* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95"; #else -static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.107 2004/02/10 01:20:12 millert Exp $"; +static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.108 2004/02/10 03:52:53 millert Exp $"; #endif #endif /* not lint */ @@ -1489,7 +1489,13 @@ sysctl_tty(char *string, char **bufpp, int mib[], int flags, int *typep) if ((indx = findname(string, "third", bufpp, &ttylist)) == -1) return (-1); mib[2] = indx; - *typep = ttylist.list[indx].ctl_type; + + if ((*typep = ttylist.list[indx].ctl_type) == CTLTYPE_STRUCT) { + if (flags) + warnx("use pstat -t to view %s information", + string); + return (-1); + } return (3); } |