mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
oss: Unbreak mmaping the ability to mmap oss fd on Linux
Signed-off-by: malc <av1474@comtv.ru>
This commit is contained in:
parent
2637c754cc
commit
2182349d73
|
@ -205,13 +205,16 @@ static int oss_open (int in, struct oss_params *req,
|
||||||
struct oss_params *obt, int *pfd)
|
struct oss_params *obt, int *pfd)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
int oflags;
|
||||||
int mmmmssss;
|
int mmmmssss;
|
||||||
audio_buf_info abinfo;
|
audio_buf_info abinfo;
|
||||||
int fmt, freq, nchannels;
|
int fmt, freq, nchannels;
|
||||||
const char *dspname = in ? conf.devpath_in : conf.devpath_out;
|
const char *dspname = in ? conf.devpath_in : conf.devpath_out;
|
||||||
const char *typ = in ? "ADC" : "DAC";
|
const char *typ = in ? "ADC" : "DAC";
|
||||||
|
|
||||||
fd = open (dspname, (in ? O_RDONLY : O_WRONLY) | O_NONBLOCK);
|
/* Kludge needed to have working mmap on Linux */
|
||||||
|
oflags = conf.try_mmap ? O_RDWR : (in ? O_RDONLY : O_WRONLY);
|
||||||
|
fd = open (dspname, oflags | O_NONBLOCK);
|
||||||
if (-1 == fd) {
|
if (-1 == fd) {
|
||||||
oss_logerr2 (errno, typ, "Failed to open `%s'\n", dspname);
|
oss_logerr2 (errno, typ, "Failed to open `%s'\n", dspname);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue