[Spice-devel] [PATCH spice-gtk] channel: HUP is not an error condition

Christophe Fergeau cfergeau at redhat.com
Tue Apr 14 04:26:08 PDT 2015


On Tue, Apr 14, 2015 at 12:31:47PM +0200, Marc-André Lureau wrote:
> On local UNIX sockets, calling close() in the server side will result in
> a HUP condition on client side. Since this is not an error, but a normal
> termination, let's ignore it.

Just out of curiosity, do you base this on some documentation/man
page/... or did you determine that through testing? Any idea if there
can be cases where HUP would be an error?

> ---
>  gtk/spice-channel.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
> index 12d61ee..1c19544 100644
> --- a/gtk/spice-channel.c
> +++ b/gtk/spice-channel.c
> @@ -2151,9 +2151,9 @@ static gboolean spice_channel_iterate(SpiceChannel *channel)
>  
>          /* We don't want to report an error if the socket was closed gracefully
>           * on the other end (VM shutdown) */
> -        ret = g_socket_condition_check(c->sock, G_IO_IN | G_IO_ERR | G_IO_HUP);
> +        ret = g_socket_condition_check(c->sock, G_IO_ERR);

Looks good to me, though I'm not sure why the G_IO_IN which you removed
was there in the first place.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150414/ad7f4960/attachment.sig>


More information about the Spice-devel mailing list