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

Victor Toso lists at victortoso.com
Thu Oct 6 11:56:54 UTC 2016


Hi,

On Thu, Oct 06, 2016 at 03:47:43PM +0400, marcandre.lureau at redhat.com wrote:
> 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>

Acked-by: Victor Toso <victortoso 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
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161006/c813a7f1/attachment.sig>


More information about the Spice-devel mailing list