]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups/http-addrlist.c
Merge changes from CUPS 1.5svn-r9352.
[thirdparty/cups.git] / cups / http-addrlist.c
index 14406427dde3cfd2fa6986271d3ec6045bc03f06..7c11d1b1a8e905168f4a20046b50a40fe35e0f7f 100644 (file)
@@ -40,9 +40,12 @@ httpAddrConnect(
     http_addrlist_t *addrlist,         /* I - List of potential addresses */
     int             *sock)             /* O - Socket */
 {
-  int  val;                            /* Socket option value */
+  int                  val;            /* Socket option value */
+#ifdef __APPLE__
+  struct timeval       timeout;        /* Socket timeout value */
+#endif /* __APPLE__ */
 #ifdef DEBUG
-  char temp[256];                      /* Temporary address string */
+  char                 temp[256];      /* Temporary address string */
 #endif /* DEBUG */
 
 
@@ -108,8 +111,9 @@ httpAddrConnect(
     * we block...
     */
 
-    val = 30;
-    setsockopt(*sock, SOL_SOCKET, SO_RCVTIMEO, &val, sizeof(val));
+    timeout.tv_sec  = 30;
+    timeout.tv_usec = 0;
+    setsockopt(*sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
 #endif /* __APPLE__ */
 
    /*