diff options
author | peter <peter@FreeBSD.org> | 1999-08-27 06:53:34 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-08-27 06:53:34 +0000 |
commit | ef5c098b80b05fce18894be29b3297b9f4436089 (patch) | |
tree | 7ff5797e76d8bb01f6b145025202b43fdbac0708 /sys | |
parent | e7fac5b9a50317abfb9c9331e56fc9ab45e4687b (diff) | |
download | FreeBSD-src-ef5c098b80b05fce18894be29b3297b9f4436089.zip FreeBSD-src-ef5c098b80b05fce18894be29b3297b9f4436089.tar.gz |
Don't return 0 for an unknown ioctl (!). This was breaking ppp(8).
Slight tidy up while here.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/si/si.c | 19 | ||||
-rw-r--r-- | sys/i386/isa/si.c | 19 |
2 files changed, 18 insertions, 20 deletions
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index c2f3b98..7ed454f 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) diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c index c2f3b98..7ed454f 100644 --- a/sys/i386/isa/si.c +++ b/sys/i386/isa/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) |