Revision cdbf6e16
b/qemu-char.c | ||
---|---|---|
781 | 781 |
len = s->max_size; |
782 | 782 |
} |
783 | 783 |
if (len == 0) { |
784 |
return FALSE;
|
|
784 |
return TRUE;
|
|
785 | 785 |
} |
786 | 786 |
|
787 | 787 |
status = g_io_channel_read_chars(chan, (gchar *)buf, |
788 | 788 |
len, &bytes_read, NULL); |
789 | 789 |
if (status == G_IO_STATUS_EOF) { |
790 |
if (s->fd_in_tag) { |
|
791 |
g_source_remove(s->fd_in_tag); |
|
792 |
s->fd_in_tag = 0; |
|
793 |
} |
|
790 | 794 |
qemu_chr_be_event(chr, CHR_EVENT_CLOSED); |
791 | 795 |
return FALSE; |
792 | 796 |
} |
... | ... | |
1105 | 1109 |
len = sizeof(buf); |
1106 | 1110 |
if (len > s->read_bytes) |
1107 | 1111 |
len = s->read_bytes; |
1108 |
if (len == 0) |
|
1109 |
return FALSE; |
|
1112 |
if (len == 0) { |
|
1113 |
return TRUE; |
|
1114 |
} |
|
1110 | 1115 |
status = g_io_channel_read_chars(s->fd, (gchar *)buf, len, &size, NULL); |
1111 | 1116 |
if (status != G_IO_STATUS_NORMAL) { |
1112 | 1117 |
pty_chr_state(chr, 0); |
... | ... | |
2238 | 2243 |
gsize bytes_read = 0; |
2239 | 2244 |
GIOStatus status; |
2240 | 2245 |
|
2241 |
if (s->max_size == 0) |
|
2242 |
return FALSE; |
|
2246 |
if (s->max_size == 0) { |
|
2247 |
return TRUE; |
|
2248 |
} |
|
2243 | 2249 |
status = g_io_channel_read_chars(s->chan, (gchar *)s->buf, sizeof(s->buf), |
2244 | 2250 |
&bytes_read, NULL); |
2245 | 2251 |
s->bufcnt = bytes_read; |
2246 | 2252 |
s->bufptr = s->bufcnt; |
2247 | 2253 |
if (status != G_IO_STATUS_NORMAL) { |
2254 |
if (s->tag) { |
|
2255 |
g_source_remove(s->tag); |
|
2256 |
s->tag = 0; |
|
2257 |
} |
|
2248 | 2258 |
return FALSE; |
2249 | 2259 |
} |
2250 | 2260 |
|
... | ... | |
2497 | 2507 |
int len, size; |
2498 | 2508 |
|
2499 | 2509 |
if (!s->connected || s->max_size <= 0) { |
2500 |
return FALSE;
|
|
2510 |
return TRUE;
|
|
2501 | 2511 |
} |
2502 | 2512 |
len = sizeof(buf); |
2503 | 2513 |
if (len > s->max_size) |
Also available in: Unified diff