summaryrefslogtreecommitdiff
path: root/src/control/hcontrol.c
diff options
context:
space:
mode:
authorAbramo Bagnara <abramo@alsa-project.org>2001-02-11 17:46:03 +0000
committerAbramo Bagnara <abramo@alsa-project.org>2001-02-11 17:46:03 +0000
commit955b9fc335537ca2eee99badcd7a216024140c52 (patch)
tree8efd8f25cb7843f91f3e86f90fd66401dbb72556 /src/control/hcontrol.c
parent8afd6e69af1d8696704ad469ac1a03e36f188fff (diff)
Fixed handle_events
Diffstat (limited to 'src/control/hcontrol.c')
-rw-r--r--src/control/hcontrol.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/control/hcontrol.c b/src/control/hcontrol.c
index 55748e2e..323feaf0 100644
--- a/src/control/hcontrol.c
+++ b/src/control/hcontrol.c
@@ -491,17 +491,20 @@ int snd_hctl_handle_events(snd_hctl_t *hctl)
{
snd_ctl_event_t event;
int res;
+ unsigned int count = 0;
assert(hctl);
assert(hctl->ctl);
- while ((res = snd_ctl_read(hctl->ctl, &event)) != 0) {
+ while ((res = snd_ctl_read(hctl->ctl, &event)) != 0 &&
+ res != -EAGAIN) {
if (res < 0)
return res;
res = snd_hctl_handle_event(hctl, &event);
if (res < 0)
return res;
+ count++;
}
- return 0;
+ return count;
}
int snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t *info)