mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-03 09:01:52 -05:00
pcm: add SND_CTL_EINTR open mode
Add possibility to return -EINTR instead waiting for the event. The applications may want to handle -EINTR condition themselves. BugLink: https://github.com/alsa-project/alsa-lib/issues/228 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
d6d5982d3a
commit
507d906abb
8 changed files with 13 additions and 8 deletions
|
|
@ -265,13 +265,14 @@ int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock)
|
|||
}
|
||||
|
||||
#ifndef DOC_HIDDEN
|
||||
int snd_ctl_new(snd_ctl_t **ctlp, snd_ctl_type_t type, const char *name)
|
||||
int snd_ctl_new(snd_ctl_t **ctlp, snd_ctl_type_t type, const char *name, int mode)
|
||||
{
|
||||
snd_ctl_t *ctl;
|
||||
ctl = calloc(1, sizeof(*ctl));
|
||||
if (!ctl)
|
||||
return -ENOMEM;
|
||||
ctl->type = type;
|
||||
ctl->mode = mode;
|
||||
if (name)
|
||||
ctl->name = strdup(name);
|
||||
INIT_LIST_HEAD(&ctl->async_handlers);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue