aboutsummaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-12-02 15:41:38 +0000
committerPeter Maydell <peter.maydell@linaro.org>2015-12-02 15:41:38 +0000
commit30a9fd5d13b0a4290382adc4c1bf619677066b89 (patch)
tree7327dbaa1da19f0e397dfef405a45755ff61a92c /qemu-char.c
parent9d7b969ea6d9663a94760c6c131481b366f4d38a (diff)
parent0c2d70c448b7853a91cfa63659aa3cc6630fb9be (diff)
downloadqemu-30a9fd5d13b0a4290382adc4c1bf619677066b89.zip
qemu-30a9fd5d13b0a4290382adc4c1bf619677066b89.tar.gz
qemu-30a9fd5d13b0a4290382adc4c1bf619677066b89.tar.bz2
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* exec.c use after free * Xen 32-on-64 breakage * missing EINTR * naughty warning under qtest # gpg: Signature made Wed 02 Dec 2015 12:13:55 GMT using RSA key ID 78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" * remotes/bonzini/tags/for-upstream: translate-all: ensure host page mask is always extended with 1's main-loop: suppress warnings under qtest qemu-char: retry g_poll on EINTR exec: Stop using memory after free Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 5448b0f..2969c44 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1241,11 +1241,16 @@ static void pty_chr_update_read_handler_locked(CharDriverState *chr)
{
PtyCharDriver *s = chr->opaque;
GPollFD pfd;
+ int rc;
pfd.fd = g_io_channel_unix_get_fd(s->fd);
pfd.events = G_IO_OUT;
pfd.revents = 0;
- g_poll(&pfd, 1, 0);
+ do {
+ rc = g_poll(&pfd, 1, 0);
+ } while (rc == -1 && errno == EINTR);
+ assert(rc >= 0);
+
if (pfd.revents & G_IO_HUP) {
pty_chr_state(chr, 0);
} else {