diff options
author | Peter Wemm <peter@FreeBSD.org> | 1999-08-27 06:53:34 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 1999-08-27 06:53:34 +0000 |
commit | 4e895e3962b65a6771f225261545f0b5c6a02534 (patch) | |
tree | db8c43dbb1fa766ae0b0dfee2be8a794aa692780 /sys/dev | |
parent | 40a94c5bc6014ab0b3ebf1613b46cb5bbedd7e38 (diff) | |
download | src-4e895e3962b65a6771f225261545f0b5c6a02534.tar.gz src-4e895e3962b65a6771f225261545f0b5c6a02534.zip |
Don't return 0 for an unknown ioctl (!). This was breaking ppp(8).
Slight tidy up while here.
Notes
Notes:
svn path=/head/; revision=50435
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/si/si.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index c2f3b9836289..7ed454f22342 100644 --- a/sys/dev/si/si.c +++ b/sys/dev/si/si.c @@ -30,7 +30,7 @@ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHORS BE LIABLE. * - * $Id: si.c,v 1.88 1999/08/18 17:42:41 nsayer Exp $ + * $Id: si.c,v 1.89 1999/08/23 20:58:48 phk Exp $ */ #ifndef lint @@ -1589,9 +1589,12 @@ siioctl(dev, cmd, data, flag, p) error = ttioctl(tp, cmd, data, flag); si_disc_optim(tp, &tp->t_termios, pp); - if (error != ENOIOCTL) - goto outspl; + if (error != ENOIOCTL) { + splx(oldspl); + goto out; + } + error = 0; switch (cmd) { case TIOCSBRK: si_command(pp, SBREAK, SI_WAIT); @@ -1620,21 +1623,17 @@ siioctl(dev, cmd, data, flag, p) case TIOCMSDTRWAIT: /* must be root since the wait applies to following logins */ error = suser(p); - if (error != 0) { - goto outspl; - } - pp->sp_dtr_wait = *(int *)data * hz / 100; + if (error == 0) + pp->sp_dtr_wait = *(int *)data * hz / 100; break; case TIOCMGDTRWAIT: *(int *)data = pp->sp_dtr_wait * 100 / hz; break; - default: error = ENOTTY; } - error = 0; -outspl: splx(oldspl); + out: DPRINT((pp, DBG_IOCTL|DBG_EXIT, "siioctl ret %d\n", error)); if (blocked) |