Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6280f190 authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Jeremy Fitzhardinge
Browse files

implement O_NONBLOCK for /proc/xen/xenbus



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: default avatarPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: default avatarJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
parent 4c31a781
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -122,6 +122,9 @@ static ssize_t xenbus_file_read(struct file *filp,
	mutex_lock(&u->reply_mutex);
	mutex_lock(&u->reply_mutex);
	while (list_empty(&u->read_buffers)) {
	while (list_empty(&u->read_buffers)) {
		mutex_unlock(&u->reply_mutex);
		mutex_unlock(&u->reply_mutex);
		if (filp->f_flags & O_NONBLOCK)
			return -EAGAIN;

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