summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2005-09-19 13:48:45 +0000
committerru <ru@FreeBSD.org>2005-09-19 13:48:45 +0000
commitdb795b2c7606fa5ffdcc900c11384e51ad99d8b1 (patch)
tree8062ddf49e66f6cc93932a7d6e93c8b57aadfe32 /sys/dev
parentc235110658b82d3add6a0ea46c53b60a0b73d467 (diff)
downloadFreeBSD-src-db795b2c7606fa5ffdcc900c11384e51ad99d8b1.zip
FreeBSD-src-db795b2c7606fa5ffdcc900c11384e51ad99d8b1.tar.gz
Restore the ability to detach from a tty via SIOCSTTY and document
recent changes in a manpage. Reviewed by: cognet
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/snp/snp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index c18a4ce..4008bae 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -527,17 +527,18 @@ snpioctl(dev, cmd, data, flags, td)
switch (cmd) {
case SNPSTTY:
s = *(int *)data;
- if (s < 0 || fget(td, s, &fp) != 0)
+ if (s < 0)
+ return (snp_down(snp));
+ if (fget(td, s, &fp) != 0)
return (EINVAL);
if (fp->f_type != DTYPE_VNODE ||
- fp->f_vnode->v_type != VCHR) {
+ fp->f_vnode->v_type != VCHR ||
+ fp->f_vnode->v_rdev == NULL) {
fdrop(fp, td);
return (EINVAL);
}
tdev = fp->f_vnode->v_rdev;
fdrop(fp, td);
- if (tdev == NULL)
- return (snp_down(snp));
tp = snpdevtotty(tdev);
if (!tp)
@@ -593,7 +594,6 @@ snpioctl(dev, cmd, data, flags, td)
*(int *)data = snp->snp_len;
else
if (snp->snp_flags & SNOOP_DOWN) {
- printf("IT IS DOWN\n");
if (snp->snp_flags & SNOOP_OFLOW)
*(int *)data = SNP_OFLOW;
else
OpenPOWER on IntegriCloud