]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Apply more thorough fixes while dealing with device opening and closing:
authorAriff Abdullah <ariff@FreeBSD.org>
Tue, 21 Mar 2006 06:35:48 +0000 (06:35 +0000)
committerAriff Abdullah <ariff@FreeBSD.org>
Tue, 21 Mar 2006 06:35:48 +0000 (06:35 +0000)
commit3fdb3676ba938c22fd21e8a70b07dfc7f5f8cbe4
tree838fdc3d7f5c9fe3b44fdd03d03852a0f53e98d2
parent02dbda9d17ca126e001063f51327227676b9d0e3
Apply more thorough fixes while dealing with device opening and closing:

- Determine open direction using 'flags', not 'mode'. This bug exist since
  past 4 years.
- Don't allow opening the same device twice, be it in a same or different
  direction.
- O_RDWR is allowed, provided that it is done by a single open (for example
  by mixer(8)) and the underlying hardware support true full-duplex operation.
- Do various paranoid checking in case other process/thread trying to hijack
  the same device twice (or more).

MFC after: 5 days
sys/dev/sound/pcm/dsp.c
sys/dev/sound/pcm/mixer.c
sys/dev/sound/pcm/sound.c
sys/dev/sound/pcm/sound.h