From: David Schleef Date: Wed, 6 Feb 2002 21:48:05 +0000 (+0000) Subject: Revert poll conditions: if device is non-busy, set the poll flags so X-Git-Tag: r0_7_64~150 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1b9eac8b5d5e3b84a7a36a1b3fd33b46b99e9cf0;p=comedi.git Revert poll conditions: if device is non-busy, set the poll flags so the app can read the error. This is how it used to be, and I'm not sure why I changed (broke) it. --- diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 3581c0e2..d72f6b12 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1289,22 +1289,20 @@ static unsigned int comedi_poll_v22(struct file *file, poll_table * wait) if(dev->read_subdev && dev->read_subdev->async){ s = dev->read_subdev; async = s->async; - if(s->busy){ - if((async->buf_user_count < async->buf_int_count) || - !(s->subdev_flags&SDF_RUNNING)){ - mask |= POLLIN | POLLRDNORM; - } + if(!s->busy || + (async->buf_user_count < async->buf_int_count) || + !(s->subdev_flags&SDF_RUNNING)){ + mask |= POLLIN | POLLRDNORM; } } if(dev->write_subdev && dev->write_subdev->async){ s = dev->write_subdev; async = s->async; - if(s->busy){ - if(!(s->subdev_flags&SDF_RUNNING) || - (async->buf_user_count < async->buf_int_count + - async->prealloc_bufsz)){ - mask |= POLLOUT | POLLWRNORM; - } + if(!s->busy || + !(s->subdev_flags&SDF_RUNNING) || + (async->buf_user_count < async->buf_int_count + + async->prealloc_bufsz)){ + mask |= POLLOUT | POLLWRNORM; } }