summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/pcm.h2
-rw-r--r--src/pcm/pcm.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/pcm.h b/include/pcm.h
index 25cd12d1..a29ea980 100644
--- a/include/pcm.h
+++ b/include/pcm.h
@@ -393,6 +393,8 @@ typedef long snd_pcm_sframes_t;
#define SND_PCM_NONBLOCK 0x00000001
/** Async notification (flag for open mode) \hideinitializer */
#define SND_PCM_ASYNC 0x00000002
+/** Return EINTR instead blocking (wait operation) */
+#define SND_PCM_EINTR 0x00000080
/** In an abort state (internal, not allowed for open) */
#define SND_PCM_ABORT 0x00008000
/** Disable automatic (but not forced!) rate resamplinig */
diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 01c624d3..41a36b36 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -2938,7 +2938,7 @@ int snd_pcm_wait_nocheck(snd_pcm_t *pcm, int timeout)
err_poll = poll(pfd, npfds, timeout);
__snd_pcm_lock(pcm->fast_op_arg);
if (err_poll < 0) {
- if (errno == EINTR && !PCMINABORT(pcm))
+ if (errno == EINTR && !PCMINABORT(pcm) && !(pcm->mode & SND_PCM_EINTR))
continue;
return -errno;
}