K 10 svn:author V 5 ariff K 8 svn:date V 27 2006-03-21T06:35:48.000000Z K 7 svn:log V 538 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 END