diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-11-09 12:22:28 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2008-11-09 12:22:28 +0000 |
commit | 352034d0e7596f5f8516e2e1c106775372f16180 (patch) | |
tree | 8fd0274ce59d225e01560bfd5012fcc8eb6a19b3 /lib/libsndio | |
parent | db7c0a00a13433599338cb2f8a7ab0699655a6e0 (diff) |
sio_revents() should return 0 poll events if the device isn't started
Diffstat (limited to 'lib/libsndio')
-rw-r--r-- | lib/libsndio/sndio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libsndio/sndio.c b/lib/libsndio/sndio.c index c76a2dbf497..22a7e660412 100644 --- a/lib/libsndio/sndio.c +++ b/lib/libsndio/sndio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sndio.c,v 1.3 2008/11/07 21:01:15 ratchov Exp $ */ +/* $OpenBSD: sndio.c,v 1.4 2008/11/09 12:22:27 ratchov Exp $ */ /* * Copyright (c) 2008 Alexandre Ratchov <alex@caoua.org> * @@ -451,6 +451,8 @@ sio_revents(struct sio_hdl *hdl, struct pollfd *pfd) #endif if (hdl->eof) return POLLHUP; + if (!hdl->started) + return 0; hdl->pollcnt++; revents = hdl->ops->revents(hdl, pfd); #ifdef DEBUG |