1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

Don't return 0 for an unknown ioctl (!). This was breaking ppp(8).

Slight tidy up while here.
This commit is contained in:
Peter Wemm 1999-08-27 06:53:34 +00:00
parent 40a94c5bc6
commit 4e895e3962
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=50435
2 changed files with 18 additions and 20 deletions

View File

@ -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)

View File

@ -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)