allow non-blocking connect to succeed, as it does on OpenBSD
[gnulib.git] / tests / test-poll.c
index 5e8d706..f97b8d5 100644 (file)
@@ -139,16 +139,12 @@ connect_to_socket (int blocking)
 #endif
     }
 
-  if (connect (s, (struct sockaddr *) &ia, sizeof (ia)) < 0)
+  if (connect (s, (struct sockaddr *) &ia, sizeof (ia)) < 0
+      && (blocking || errno != EINPROGRESS))
     {
-      if (errno != EINPROGRESS)
-       {
-         perror ("connect");
-         exit (77);
-       }
+      perror ("connect");
+      exit (77);
     }
-  else if (!blocking)
-    failed ("huh, connect succeeded?");
 
   return s;
 }