CCL: fix use of "term" field in sub queries
[yaz-moved-to-github.git] / src / spipe.c
index f42c8f1..43e9852 100644 (file)
@@ -1,5 +1,5 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2010 Index Data
+ * Copyright (C) 1995-2012 Index Data
  * See the file LICENSE for details.
  */
 
 #include <sys/socket.h>
 #endif
 
+#if HAVE_NETINET_IN_H
 #include <netinet/in.h>
+#endif
+#if HAVE_NETDB_H
 #include <netdb.h>
+#endif
+#if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
+#endif
+#if HAVE_NETINET_TCP_H
 #include <netinet/tcp.h>
+#endif
 
 struct yaz_spipe {
     int m_fd[2];
@@ -117,7 +125,7 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
 #endif
         fd_set write_set;
 
-        // create server socket
+        /* create server socket */
         p->m_socket = socket(AF_INET, SOCK_STREAM, 0);
         if (p->m_socket == YAZ_INVALID_SOCKET)
         {
@@ -139,7 +147,7 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
             }
         }
 #endif
-        // bind server socket
+        /* bind server socket */
         add.sin_family = AF_INET;
         add.sin_port = htons(port_to_use);
         add.sin_addr.s_addr = INADDR_ANY;
@@ -161,7 +169,7 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
             return 0;
         }
 
-        // client socket
+        /* client socket */
         tmpadd = (unsigned) inet_addr("127.0.0.1");
         if (!tmpadd)
         {
@@ -186,9 +194,9 @@ yaz_spipe_t yaz_spipe_create(int port_to_use, WRBUF *err_msg)
         {
             if (
 #ifdef WIN32
-            WSAGetLastError() != WSAEWOULDBLOCK
+                WSAGetLastError() != WSAEWOULDBLOCK
 #else
-            errno != EINPROGRESS
+                errno != EINPROGRESS
 #endif
                 )
             {