From eaf53a9e1935c3948a743f014822aecb80ae50c5 Mon Sep 17 00:00:00 2001 From: Amit Shah Date: Wed, 19 May 2010 22:15:49 -0600 Subject: [PATCH] --- yaml --- r: 197870 b: refs/heads/master c: 60caacd3eeab68672961e88db01e26735527d521 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/char/virtio_console.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 8d85729d213c..83c4f59acf05 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1d05160be743c506b1d6926e7c637496fa750cd3 +refs/heads/master: 60caacd3eeab68672961e88db01e26735527d521 diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index 6207e3729923..a39bf191da02 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -479,9 +479,9 @@ static ssize_t fill_readbuf(struct port *port, char *out_buf, size_t out_count, } /* The condition that must be true for polling to end */ -static bool wait_is_over(struct port *port) +static bool will_read_block(struct port *port) { - return port_has_data(port) || !port->host_connected; + return !port_has_data(port) && port->host_connected; } static ssize_t port_fops_read(struct file *filp, char __user *ubuf, @@ -504,7 +504,7 @@ static ssize_t port_fops_read(struct file *filp, char __user *ubuf, return -EAGAIN; ret = wait_event_interruptible(port->waitqueue, - wait_is_over(port)); + !will_read_block(port)); if (ret < 0) return ret; }