]> granicus.if.org Git - curl/commitdiff
1. changed order of two include files to build fine on MPE/iX
authorDaniel Stenberg <daniel@haxx.se>
Thu, 29 Jan 2004 15:29:47 +0000 (15:29 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 29 Jan 2004 15:29:47 +0000 (15:29 +0000)
2. now reads the socket error before check connect status, also to make us
   run fine on MPE/iX

lib/connect.c

index 69f8ce374b7f01bf312945e37ddea3ec88878a7a..0d8d278f82147c6635d3988095c92b19b13bfc68 100644 (file)
 #ifndef WIN32
 /* headers for non-win32 */
 #include <sys/time.h>
-#include <sys/socket.h>
+#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
 #include <sys/ioctl.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -171,6 +175,11 @@ int waitconnect(int sockfd, /* socket */
   struct timeval interval;
   int rc;
 
+  /* Call this function once now, and ignore the results. We do this to
+     "clear" the error state on the socket so that we can later read it
+     reliably. This is reported necessary on the MPE/iX operating system. */
+  verifyconnect();
+
   /* now select() until we get connect or timeout */
   FD_ZERO(&fd);
   FD_SET(sockfd, &fd);