From bde4144593197efb4fa5ac993313acc526179f56 Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Thu, 6 Oct 2016 15:46:37 +0400 Subject: spicy: only watch stdin if testing org.spice.spicy port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes starting spicy with a shell in the background with &, spicy would hang in tcsetattr(). Signed-off-by: Marc-André Lureau Acked-by: Victor Toso --- 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); -- cgit v1.2.3