diff --git a/lib/connect.c b/lib/connect.c index 69f8ce374b..0d8d278f82 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -26,8 +26,12 @@ #ifndef WIN32 /* headers for non-win32 */ #include -#include +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif #include #ifdef HAVE_UNISTD_H #include @@ -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);