Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165056
b: refs/heads/master
c: 8cd0166
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent f507255 commit aa5aa4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 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: 798199867385417ba6494472e39c016e3340758c
refs/heads/master: 8cd01664344e983d73a85ce604f7c23f475cf303
8 changes: 7 additions & 1 deletion trunk/drivers/usb/usb-skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count, loff_t *
spin_unlock_irq(&dev->err_lock);

if (ongoing_io) {
/* nonblocking IO shall not wait */
if (file->f_flags & O_NONBLOCK) {
rv = -EAGAIN;
goto exit;
}
/*
* IO may take forever
* hence wait in an interruptible state
Expand Down Expand Up @@ -351,8 +356,9 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count, loff_t *
rv = skel_do_read_io(dev, count);
if (rv < 0)
goto exit;
else
else if (!file->f_flags & O_NONBLOCK)
goto retry;
rv = -EAGAIN;
}
exit:
mutex_unlock(&dev->io_mutex);
Expand Down

0 comments on commit aa5aa4c

Please sign in to comment.