summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-06 15:46:37 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2016-10-06 16:04:56 +0400
commitbde4144593197efb4fa5ac993313acc526179f56 (patch)
tree748672cad390c2bfdc105a0b765f285ff74bd28f
parent6f11f5599680dd365435597237f4b62b65da1af3 (diff)
spicy: only watch stdin if testing org.spice.spicy port
This fixes starting spicy with a shell in the background with &, spicy would hang in tcsetattr(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Victor Toso <victortoso@redhat.com>
-rw-r--r--src/spicy.c5
1 files 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);