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

Commit a08fa92d authored by Amit Shah's avatar Amit Shah Committed by Rusty Russell
Browse files

virtio: console: Use wait_event_freezable instead of _interruptible



Get ready to support suspend/resume by using the freezable calls so that
blocking read/write syscalls are handled properly across suspend/resume.

Signed-off-by: default avatarAmit Shah <amit.shah@redhat.com>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 291024ef
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <linux/debugfs.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/freezer.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/list.h>
@@ -633,7 +634,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf,
		if (filp->f_flags & O_NONBLOCK)
			return -EAGAIN;

		ret = wait_event_interruptible(port->waitqueue,
		ret = wait_event_freezable(port->waitqueue,
					   !will_read_block(port));
		if (ret < 0)
			return ret;
@@ -677,7 +678,7 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf,
		if (nonblock)
			return -EAGAIN;

		ret = wait_event_interruptible(port->waitqueue,
		ret = wait_event_freezable(port->waitqueue,
					   !will_write_block(port));
		if (ret < 0)
			return ret;