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

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

 



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.

A clean shutdown would involve a new message to tell the client to first
close its end, in order to avoid the HUP. That way the client could
distinguish normal termination from unexpected ones. That's a possible
future minor enhancement (it seems it would only work with UNIX socket
though)

https://bugs.freedesktop.org/show_bug.cgi?id=90016
---
 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);
 
-        if (ret & (G_IO_ERR|G_IO_HUP)) {
+        if (ret & G_IO_ERR) {
             CHANNEL_DEBUG(channel, "channel got error");
 
             if (c->state > SPICE_CHANNEL_STATE_CONNECTING) {
-- 
2.1.0

_______________________________________________
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]