diff options
-rw-r--r-- | litmus/ftdev.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/litmus/ftdev.c b/litmus/ftdev.c index 3722a523b157..6de7b169df93 100644 --- a/litmus/ftdev.c +++ b/litmus/ftdev.c | |||
@@ -216,6 +216,17 @@ static ssize_t ftdev_read(struct file *filp, | |||
216 | * here with copied data because that data would get | 216 | * here with copied data because that data would get |
217 | * lost if the task is interrupted (e.g., killed). | 217 | * lost if the task is interrupted (e.g., killed). |
218 | */ | 218 | */ |
219 | |||
220 | /* Before sleeping, check wether a non-blocking | ||
221 | * read was requested. | ||
222 | */ | ||
223 | if (filp->f_flags & O_NONBLOCK) | ||
224 | { | ||
225 | /* bug out, userspace doesn't want us to sleep */ | ||
226 | err = -EWOULDBLOCK; | ||
227 | break; | ||
228 | } | ||
229 | |||
219 | mutex_unlock(&ftdm->lock); | 230 | mutex_unlock(&ftdm->lock); |
220 | set_current_state(TASK_INTERRUPTIBLE); | 231 | set_current_state(TASK_INTERRUPTIBLE); |
221 | 232 | ||