summaryrefslogtreecommitdiff
path: root/qemu-char.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-06-18 08:43:57 +0200
committerLuiz Capitulino <lcapitulino@redhat.com>2014-06-23 11:12:28 -0400
commit1bb7fe725c5f24a441c93fcffddcf4726f11cab5 (patch)
tree8ffc026f3bb601f0a84ced9f4473244c72540921 /qemu-char.c
parent6975b713e695e7f1c24a5437fe71fe45381aeebf (diff)
downloadqemu-1bb7fe725c5f24a441c93fcffddcf4726f11cab5.tar.gz
qemu-1bb7fe725c5f24a441c93fcffddcf4726f11cab5.tar.bz2
qemu-1bb7fe725c5f24a441c93fcffddcf4726f11cab5.zip
qemu-char: move pty_chr_update_read_handler around
Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r--qemu-char.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/qemu-char.c b/qemu-char.c
index 28ea9f20df..9961b02ce6 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -1101,6 +1101,22 @@ static void pty_chr_rearm_timer(CharDriverState *chr, int ms)
}
}
+static void pty_chr_update_read_handler(CharDriverState *chr)
+{
+ PtyCharDriver *s = chr->opaque;
+ GPollFD pfd;
+
+ pfd.fd = g_io_channel_unix_get_fd(s->fd);
+ pfd.events = G_IO_OUT;
+ pfd.revents = 0;
+ g_poll(&pfd, 1, 0);
+ if (pfd.revents & G_IO_HUP) {
+ pty_chr_state(chr, 0);
+ } else {
+ pty_chr_state(chr, 1);
+ }
+}
+
static int pty_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
{
PtyCharDriver *s = chr->opaque;
@@ -1153,22 +1169,6 @@ static gboolean pty_chr_read(GIOChannel *chan, GIOCondition cond, void *opaque)
return TRUE;
}
-static void pty_chr_update_read_handler(CharDriverState *chr)
-{
- PtyCharDriver *s = chr->opaque;
- GPollFD pfd;
-
- pfd.fd = g_io_channel_unix_get_fd(s->fd);
- pfd.events = G_IO_OUT;
- pfd.revents = 0;
- g_poll(&pfd, 1, 0);
- if (pfd.revents & G_IO_HUP) {
- pty_chr_state(chr, 0);
- } else {
- pty_chr_state(chr, 1);
- }
-}
-
static void pty_chr_state(CharDriverState *chr, int connected)
{
PtyCharDriver *s = chr->opaque;