mirror of
https://gitee.com/openharmony/third_party_alsa-lib
synced 2024-12-12 18:45:41 +00:00
Fixed for fcntl calls (NONBLOCK)...
This commit is contained in:
parent
dc6d1ffeb0
commit
54c4a6c610
@ -100,13 +100,13 @@ int snd_pcm_block_mode(void *handle, int enable)
|
||||
pcm = (snd_pcm_t *) handle;
|
||||
if (!pcm)
|
||||
return -EINVAL;
|
||||
if (fcntl(pcm->fd, F_GETFL, &flags) < 0)
|
||||
if ((flags = fcntl(pcm->fd, F_GETFL)) < 0)
|
||||
return -errno;
|
||||
if (enable)
|
||||
flags |= O_NONBLOCK;
|
||||
else
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(pcm->fd, F_SETFL, &flags) < 0)
|
||||
if (fcntl(pcm->fd, F_SETFL, flags) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
@ -101,13 +101,13 @@ int snd_pcm_loopback_block_mode(void *handle, int enable)
|
||||
lb = (snd_pcm_loopback_t *) handle;
|
||||
if (!lb)
|
||||
return -EINVAL;
|
||||
if (fcntl(lb->fd, F_GETFL, &flags) < 0)
|
||||
if ((flags = fcntl(lb->fd, F_GETFL)) < 0)
|
||||
return -errno;
|
||||
if (enable)
|
||||
flags |= O_NONBLOCK;
|
||||
else
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(lb->fd, F_SETFL, &flags) < 0)
|
||||
if (fcntl(lb->fd, F_SETFL, flags) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
@ -100,13 +100,13 @@ int snd_rawmidi_block_mode(void *handle, int enable)
|
||||
rmidi = (snd_rawmidi_t *) handle;
|
||||
if (!rmidi)
|
||||
return -EINVAL;
|
||||
if (fcntl(rmidi->fd, F_GETFL, &flags) < 0)
|
||||
if ((flags = fcntl(rmidi->fd, F_GETFL)) < 0)
|
||||
return -errno;
|
||||
if (enable)
|
||||
flags |= O_NONBLOCK;
|
||||
else
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(rmidi->fd, F_SETFL, &flags) < 0)
|
||||
if (fcntl(rmidi->fd, F_SETFL, flags) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
@ -134,13 +134,13 @@ int snd_seq_block_mode(void *handle, int enable)
|
||||
seq = (snd_seq_t *) handle;
|
||||
if (!seq)
|
||||
return -EINVAL;
|
||||
if (fcntl(seq->fd, F_GETFL, &flags) < 0)
|
||||
if ((flags = fcntl(seq->fd, F_GETFL)) < 0)
|
||||
return -errno;
|
||||
if (enable)
|
||||
flags |= O_NONBLOCK;
|
||||
else
|
||||
flags &= ~O_NONBLOCK;
|
||||
if (fcntl(seq->fd, F_SETFL, &flags) < 0)
|
||||
if (fcntl(seq->fd, F_SETFL, flags) < 0)
|
||||
return -errno;
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,3 +11,4 @@ seq_LDADD=../src/libasound.la
|
||||
INCLUDES=-I$(top_srcdir)/include
|
||||
CFLAGS=-static -Wall -pipe -g
|
||||
|
||||
EXTRA_DIST=seq-decoder.c seq-sender.c
|
||||
|
Loading…
Reference in New Issue
Block a user