changeset 30136:344142aabdce

allow non-blocking connect to succeed, as it does on OpenBSD 2008-09-16 Paolo Bonzini <bonzini@gnu.org> * tests/test-poll.c (connect_to_socket): Allow non-blocking connect to succeed.
author Paolo Bonzini <bonzini@gnu.org>
date Tue, 16 Sep 2008 10:26:26 +0200
parents 7b4e990d9c2c
children f8a896837471
files ChangeLog tests/test-poll.c
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Sep 15 14:37:49 2008 +0200
+++ b/ChangeLog	Tue Sep 16 10:26:26 2008 +0200
@@ -1,3 +1,8 @@
+2008-09-16  Paolo Bonzini  <bonzini@gnu.org>
+
+	* tests/test-poll.c (connect_to_socket): Allow non-blocking connect
+	to succeed.
+
 2008-09-16  Jim Meyering  <meyering@redhat.com>
 
 	avoid spurious test failure when library is built without ACL support
--- a/tests/test-poll.c	Mon Sep 15 14:37:49 2008 +0200
+++ b/tests/test-poll.c	Tue Sep 16 10:26:26 2008 +0200
@@ -139,16 +139,12 @@
 #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;
 }