Skip to content

Commit

Permalink
implement O_NONBLOCK for /proc/xen/xenbus
Browse files Browse the repository at this point in the history
This patch implements O_NONBLOCK for /proc/xen/xenbus.  It is a simple
matter of returning -EAGAIN instead of waiting on a queue.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
  • Loading branch information
Paolo Bonzini authored and Jeremy Fitzhardinge committed Jul 26, 2010
1 parent 4c31a78 commit 6280f19
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/xen/xenfs/xenbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ static ssize_t xenbus_file_read(struct file *filp,
mutex_lock(&u->reply_mutex);
while (list_empty(&u->read_buffers)) {
mutex_unlock(&u->reply_mutex);
if (filp->f_flags & O_NONBLOCK)
return -EAGAIN;

ret = wait_event_interruptible(u->read_waitq,
!list_empty(&u->read_buffers));
if (ret)
Expand Down

0 comments on commit 6280f19

Please sign in to comment.