mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
oss: fix O_NONBLOCK in dmasound_core
We broke O_NONBLOCK handling in OSS dmasound_core in 2.3.11-pre3 - the original code copied f_flags to open_mode and then checked for O_NONBLOCK in there, but that got changed to copying f_mode and O_NONBLOCK has not reached that field in any kernel version. Since we do not care for any other bits, the fix is obvious... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
67d1128425
commit
4b30fbde91
@ -235,7 +235,7 @@ struct sound_queue {
|
|||||||
*/
|
*/
|
||||||
int active;
|
int active;
|
||||||
wait_queue_head_t action_queue, open_queue, sync_queue;
|
wait_queue_head_t action_queue, open_queue, sync_queue;
|
||||||
fmode_t open_mode;
|
int non_blocking;
|
||||||
int busy, syncing, xruns, died;
|
int busy, syncing, xruns, died;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -603,7 +603,7 @@ static ssize_t sq_write(struct file *file, const char __user *src, size_t uLeft,
|
|||||||
while (uLeft) {
|
while (uLeft) {
|
||||||
while (write_sq.count >= write_sq.max_active) {
|
while (write_sq.count >= write_sq.max_active) {
|
||||||
sq_play();
|
sq_play();
|
||||||
if (write_sq.open_mode & O_NONBLOCK)
|
if (write_sq.non_blocking)
|
||||||
return uWritten > 0 ? uWritten : -EAGAIN;
|
return uWritten > 0 ? uWritten : -EAGAIN;
|
||||||
SLEEP(write_sq.action_queue);
|
SLEEP(write_sq.action_queue);
|
||||||
if (signal_pending(current))
|
if (signal_pending(current))
|
||||||
@ -718,7 +718,7 @@ static int sq_open2(struct sound_queue *sq, struct file *file, fmode_t mode,
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
sq->open_mode = file->f_mode;
|
sq->non_blocking = file->f_flags & O_NONBLOCK;
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user