[Spice-devel] [PATCH spice-gtk] spicy: only watch stdin if testing org.spice.spicy port

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Thu Oct 6 11:47:43 UTC 2016


From: Marc-André Lureau <marcandre.lureau at redhat.com>

This fixes starting spicy with a shell in the background with &, spicy
would hang in tcsetattr().

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 src/spicy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/spicy.c b/src/spicy.c
index a000e09..92de251 100644
--- a/src/spicy.c
+++ b/src/spicy.c
@@ -1409,6 +1409,8 @@ static gboolean input_cb(GIOChannel *gin, GIOCondition condition, gpointer data)
     return TRUE;
 }
 
+static void watch_stdin(void);
+
 static void port_opened(SpiceChannel *channel, GParamSpec *pspec,
                         spice_connection *conn)
 {
@@ -1432,6 +1434,7 @@ static void port_opened(SpiceChannel *channel, GParamSpec *pspec,
 
         /* handle the first spicy port and connect it to stdin/out */
         if (g_strcmp0(name, "org.spice.spicy") == 0 && stdin_port == NULL) {
+            watch_stdin();
             stdin_port = port;
         }
     } else {
@@ -1908,8 +1911,6 @@ int main(int argc, char *argv[])
     g_free(tls_port);
     g_free(unix_path);
 
-    watch_stdin();
-
     connection_connect(conn);
     if (connections > 0)
         g_main_loop_run(mainloop);
-- 
2.10.0



More information about the Spice-devel mailing list