Set a lower bound on fragment size rather than returning a failure

when the user specifies a maximum fragment size < 2.

This is the behavior that Linux provides and fixes the problem I've
observed in Tribes2 where sounds effects are delayed by 1/2 a second.
This commit is contained in:
mdodd 2003-06-26 13:13:18 +00:00
parent a70925a0c1
commit eb5358bc43

View File

@ -774,10 +774,8 @@ dsp_ioctl(dev_t i_dev, u_long cmd, caddr_t arg, int mode, struct thread *td)
if (maxfrags == 0)
maxfrags = CHN_2NDBUFMAXSIZE / fragsz;
if (maxfrags < 2) {
ret = EINVAL;
break;
}
if (maxfrags < 2)
maxfrags = 2;
if (maxfrags * fragsz > CHN_2NDBUFMAXSIZE)
maxfrags = CHN_2NDBUFMAXSIZE / fragsz;