From ce504e7439b8f94cc5b4cad52bbbefced8ad0dbf Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Fri, 27 Jun 2008 18:00:26 +0000 Subject: [PATCH] Fixed poll/select on write subdevice. --- comedi/comedi_fops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/comedi/comedi_fops.c b/comedi/comedi_fops.c index 2e6f5885..886ed7a1 100644 --- a/comedi/comedi_fops.c +++ b/comedi/comedi_fops.c @@ -1471,11 +1471,12 @@ static unsigned int comedi_poll(struct file *file, poll_table * wait) write_subdev = comedi_get_write_subdevice(dev, minor); if (write_subdev) { poll_wait(file, &write_subdev->async->wait_head, wait); + comedi_buf_write_alloc(write_subdev->async, write_subdev->async->prealloc_bufsz); if (!write_subdev->busy || !(comedi_get_subdevice_runflags(write_subdev) & SRF_RUNNING) - || comedi_buf_write_n_available(write_subdev->async) > - 0) { + || comedi_buf_write_n_allocated(write_subdev->async) >= + bytes_per_sample(write_subdev->async->subdevice)) { mask |= POLLOUT | POLLWRNORM; } } -- 2.26.2