[Spice-devel] [PATCH] Don't warn if setsockopt(TCP_NDELAY) fails with errno==ENOTSUP

Daniel P. Berrange berrange at redhat.com
Tue Feb 7 07:58:47 PST 2012


From: "Daniel P. Berrange" <berrange at redhat.com>

If connecting to a UNIX domain socket, it is expected that the
setsockopt(TCP_NDELAY) call will fail with errno=ENOTSUP, so don't
issue a warning in that case
---
 gtk/spice-channel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index bdfb02b..e4d041e 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2193,7 +2193,7 @@ ssl_reconnect:
 connected:
     rc = setsockopt(g_socket_get_fd(c->sock), IPPROTO_TCP, TCP_NODELAY,
                     (const char*)&delay_val, sizeof(delay_val));
-    if (rc != 0) {
+    if (rc != 0 && errno != ENOTSUP) {
         g_warning("%s: could not set sockopt TCP_NODELAY: %s", c->name,
                   strerror(errno));
     }
-- 
1.7.7.6



More information about the Spice-devel mailing list