Mercurial > hg > octave-nkf > gnulib-hg
changeset 10445:300e6d474c15
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 | e7595530873e |
children | 303c1060b869 |
files | ChangeLog tests/test-poll.c |
diffstat | 2 files changed, 9 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -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 +++ b/tests/test-poll.c @@ -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; }