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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: pgpJTRL6kvYCt.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]