[Spice-devel] [PATCH usbredir 6/9] Add a few log messages.
Jeremy White
jwhite at codeweavers.com
Wed Dec 9 14:17:01 PST 2015
Signed-off-by: Jeremy White <jwhite at codeweavers.com>
---
usbredirtestserver/usbredirtestserver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/usbredirtestserver/usbredirtestserver.c b/usbredirtestserver/usbredirtestserver.c
index 00c82ae..0bca621 100644
--- a/usbredirtestserver/usbredirtestserver.c
+++ b/usbredirtestserver/usbredirtestserver.c
@@ -133,6 +133,7 @@ static int usbredirtestserver_read(void *priv, uint8_t *data, int count)
return -1;
}
if (r == 0) { /* Server disconnected */
+ fprintf(stderr, "read(%d) returns 0; closing.\n", info->fd);
close(info->fd);
info->fd = -1;
}
@@ -148,6 +149,7 @@ static int usbredirtestserver_write(void *priv, uint8_t *data, int count)
if (errno == EAGAIN)
return 0;
if (errno == EPIPE) { /* Server disconnected */
+ fprintf(stderr, "write(%d) returns EPIPE; closing.\n", info->fd);
close(info->fd);
info->fd = -1;
return 0;
@@ -511,6 +513,7 @@ static void usbredirtestserver_cmdline_ctrl(private_info_t *info, char *buf)
struct usb_redir_control_packet_header control_packet;
if (parse_ctrl(buf, &control_packet, &data, &data_len)) {
+ fprintf(stderr, "Unable to parse ctrl; closing.\n");
close(info->fd);
info->fd = -1;
return;
--
2.1.4
More information about the Spice-devel
mailing list