[Spice-devel] [PATCH spice-gtk] spicy: Fix compilation breaking due to a compiler warning

Hans de Goede hdegoede at redhat.com
Wed Dec 19 06:36:49 PST 2012


This fixes:
spicy.c:1711:10: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 gtk/spicy.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gtk/spicy.c b/gtk/spicy.c
index dd8c970..3d9085f 100644
--- a/gtk/spicy.c
+++ b/gtk/spicy.c
@@ -1705,10 +1705,15 @@ end:
 static void port_data(SpicePortChannel *port,
                       gpointer data, int size, spice_connection *conn)
 {
+    int r;
+
     if (port != stdin_port)
         return;
 
-    write(fileno(stdout), data, size);
+    r = write(fileno(stdout), data, size);
+    if (r != size) {
+        g_warning("port write failed result %d/%d errno %d", r, size, errno);
+    }
 }
 
 static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
-- 
1.8.0.2



More information about the Spice-devel mailing list