* ext/socket/socket.c (ruby_connect): workaround for the setup of
Cygwin socket(EALREADY). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cbc3756009
commit
18efb38b21
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jul 12 15:11:48 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/socket/socket.c (ruby_connect): workaround for the setup of
|
||||||
|
Cygwin socket(EALREADY).
|
||||||
|
|
||||||
Mon Jul 9 16:49:30 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
Mon Jul 9 16:49:30 2001 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* ext/extmk.rb.in: modify RM macro.
|
* ext/extmk.rb.in: modify RM macro.
|
||||||
|
@ -709,6 +709,9 @@ ruby_connect(fd, sockaddr, len, socks)
|
|||||||
{
|
{
|
||||||
int status;
|
int status;
|
||||||
int mode;
|
int mode;
|
||||||
|
#if defined __CYGWIN__
|
||||||
|
int wait_in_progress = -1;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_FCNTL)
|
#if defined(HAVE_FCNTL)
|
||||||
mode = fcntl(fd, F_GETFL, 0);
|
mode = fcntl(fd, F_GETFL, 0);
|
||||||
@ -744,17 +747,23 @@ ruby_connect(fd, sockaddr, len, socks)
|
|||||||
#ifdef EINPROGRESS
|
#ifdef EINPROGRESS
|
||||||
case EINPROGRESS:
|
case EINPROGRESS:
|
||||||
#if defined __CYGWIN__
|
#if defined __CYGWIN__
|
||||||
{
|
wait_in_progress = 10;
|
||||||
struct timeval tv;
|
|
||||||
tv.tv_sec = 0;
|
|
||||||
tv.tv_usec = 100000;
|
|
||||||
rb_thread_wait_for(tv);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
thread_write_select(fd);
|
thread_write_select(fd);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
#if defined __CYGWIN__
|
||||||
|
case EALREADY:
|
||||||
|
case EINVAL:
|
||||||
|
if (--wait_in_progress > 0) {
|
||||||
|
struct timeval tv = {0, 100000};
|
||||||
|
rb_thread_wait_for(tv);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef EISCONN
|
#ifdef EISCONN
|
||||||
case EISCONN:
|
case EISCONN:
|
||||||
status = 0;
|
status = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user