Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199864
b: refs/heads/master
c: d261154
h: refs/heads/master
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 4, 2010
1 parent 091af99 commit d97e70d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee4063fa6bd801fa6ea045f23a2934db009b3dac
refs/heads/master: d261154057c27f6c1d256b6198b0ad08733f1758
23 changes: 13 additions & 10 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,19 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
while (nbytes > 0 && !retval) {
set_current_state(TASK_INTERRUPTIBLE);

if (!(comedi_get_subdevice_runflags(s) & SRF_RUNNING)) {
if (count == 0) {
if (comedi_get_subdevice_runflags(s) &
SRF_ERROR) {
retval = -EPIPE;
} else {
retval = 0;
}
do_become_nonbusy(dev, s);
}
break;
}

n = nbytes;

m = n;
Expand All @@ -1588,16 +1601,6 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
n = m;

if (n == 0) {
if (!(comedi_get_subdevice_runflags(s) & SRF_RUNNING)) {
if (comedi_get_subdevice_runflags(s) &
SRF_ERROR) {
retval = -EPIPE;
} else {
retval = 0;
}
do_become_nonbusy(dev, s);
break;
}
if (file->f_flags & O_NONBLOCK) {
retval = -EAGAIN;
break;
Expand Down

0 comments on commit d97e70d

Please sign in to comment.