From 1b9eac8b5d5e3b84a7a36a1b3fd33b46b99e9cf0 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Wed, 6 Feb 2002 21:48:05 +0000 Subject: [PATCH] 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. --- comedi/comedi_fops.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) 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; } } -- 2.26.2