summaryrefslogtreecommitdiff
path: root/lib/libsndio
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-12-27 11:35:51 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2008-12-27 11:35:51 +0000
commita29d39b13352db2843c07700d020a626210312a3 (patch)
tree723d694e3a0bcd78a953a9d816132d520c6b3350 /lib/libsndio
parent3c16c7b79443caf0bd961413ae693609f3e0c9c9 (diff)
when using the aucat(1) backend, don't mask the POLLHUP bit
even if the device is not started yet. This way, if the server is killed programs can notice it.
Diffstat (limited to 'lib/libsndio')
-rw-r--r--lib/libsndio/aucat.c4
-rw-r--r--lib/libsndio/sndio.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c
index e8fe108217a..12701c18c2c 100644
--- a/lib/libsndio/aucat.c
+++ b/lib/libsndio/aucat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aucat.c,v 1.8 2008/12/21 10:03:25 ratchov Exp $ */
+/* $OpenBSD: aucat.c,v 1.9 2008/12/27 11:35:50 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -564,7 +564,7 @@ aucat_revents(struct sio_hdl *sh, struct pollfd *pfd)
}
if (hdl->sa.eof)
return POLLHUP;
- return revents & hdl->events;
+ return revents & (hdl->events | POLLHUP);
}
int
diff --git a/lib/libsndio/sndio.c b/lib/libsndio/sndio.c
index a3b9c1eca67..979ed0e24bd 100644
--- a/lib/libsndio/sndio.c
+++ b/lib/libsndio/sndio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndio.c,v 1.11 2008/12/21 10:03:25 ratchov Exp $ */
+/* $OpenBSD: sndio.c,v 1.12 2008/12/27 11:35:50 ratchov Exp $ */
/*
* Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org>
*
@@ -465,12 +465,12 @@ sio_revents(struct sio_hdl *hdl, struct pollfd *pfd)
#endif
if (hdl->eof)
return POLLHUP;
- if (!hdl->started)
- return 0;
#ifdef DEBUG
hdl->pollcnt++;
#endif
revents = hdl->ops->revents(hdl, pfd);
+ if (!hdl->started)
+ return revents & POLLHUP;
#ifdef DEBUG
if (hdl->debug >= 2) {
gettimeofday(&tv1, NULL);