]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
portability problem for non-blocking connect() with sony newsos
authorwessels <>
Tue, 12 Jan 1999 04:29:46 +0000 (04:29 +0000)
committerwessels <>
Tue, 12 Jan 1999 04:29:46 +0000 (04:29 +0000)
src/comm.cc

index cb242836e1de6ada1bb758d4fa96f11038c23545..d30f1d407ef09b1eac664fe36de2c6ea184ff49e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.294 1999/01/08 21:12:08 wessels Exp $
+ * $Id: comm.cc,v 1.295 1999/01/11 21:29:46 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -413,6 +413,16 @@ comm_connect_addr(int sock, const struct sockaddr_in *address)
        if (x < 0)
            debug(5, 9) ("connect FD %d: %s\n", sock, xstrerror());
     } else {
+#if defined(sony)
+       /* Makoto MATSUSHITA <matusita@ics.es.osaka-u.ac.jp> */
+       connect(sock, (struct sockaddr *) address, sizeof(*address));
+       if (errno == EINVAL) {
+           errlen = sizeof(err);
+           x = getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &errlen);
+           if (x >= 0)
+               errno = x;
+       }
+#else
        errlen = sizeof(err);
        x = getsockopt(sock, SOL_SOCKET, SO_ERROR, &err, &errlen);
        if (x == 0)
@@ -426,6 +436,7 @@ comm_connect_addr(int sock, const struct sockaddr_in *address)
         */
        if (x < 0 && errno == EPIPE)
            errno = ENOTCONN;
+#endif
 #endif
     }
     if (errno == 0 || errno == EISCONN)