diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-12-27 12:10:43 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-12-27 12:10:43 +0000 |
commit | e35ff78e111f5d4954ceb6cfd856bc4ab2a0d686 (patch) | |
tree | d866d48414aa6b766d68e46900e9856d0fead96f /lib | |
parent | a29d39b13352db2843c07700d020a626210312a3 (diff) |
when polling aucat(1) socket, don't set the POLLIN bit if we
don't expect messages. Avoids busy loops in programs calling
poll(2) on a stopped device.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libsndio/aucat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libsndio/aucat.c b/lib/libsndio/aucat.c index 12701c18c2c..59a345954c0 100644 --- a/lib/libsndio/aucat.c +++ b/lib/libsndio/aucat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aucat.c,v 1.9 2008/12/27 11:35:50 ratchov Exp $ */ +/* $OpenBSD: aucat.c,v 1.10 2008/12/27 12:10:42 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -537,7 +537,7 @@ aucat_pollfd(struct sio_hdl *sh, struct pollfd *pfd, int events) hdl->events = events; if (hdl->maxwrite <= 0) events &= ~POLLOUT; - if (hdl->rstate != STATE_DATA) + if (hdl->rstate == STATE_MSG) events |= POLLIN; pfd->fd = hdl->fd; pfd->events = events; |