[Spice-devel] [PATCH spice-gtk] setsockopt: check for ENOTSUP only if defined

Uri Lublin uril at redhat.com
Thu Apr 19 01:41:15 PDT 2012


For windows (mingw32) ENOTSUP is not defined.

Related to 3bfadb8587f59a74d373e26385d348a105c2e425
---
 gtk/spice-channel.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/gtk/spice-channel.c b/gtk/spice-channel.c
index 783b94a..3952e9a 100644
--- a/gtk/spice-channel.c
+++ b/gtk/spice-channel.c
@@ -2200,7 +2200,11 @@ 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 && errno != ENOTSUP) {
+    if ((rc != 0)
+#ifdef ENOTSUP
+        && (errno != ENOTSUP)
+#endif
+        ) {
         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