diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-22 04:30:11 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1999-09-22 04:30:11 +0000 |
commit | 8aad024e3ac6524f8bc09d839a331f926eab30ec (patch) | |
tree | 826107ddf61a637dcb32d60f334bf56c27d72dc1 /win32/win32.c | |
parent | 70a444b0cc703a2fd3e05045cd1e36266221149e (diff) | |
download | ruby-8aad024e3ac6524f8bc09d839a331f926eab30ec.tar.gz |
19990922
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c index beb9545af1..a28006ce86 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -677,7 +677,8 @@ mypclose(FILE *fp) // // close the pipe // - CloseHandle(MyPopenRecord[i].oshandle); + // Closehandle() is done by fclose(). + //CloseHandle(MyPopenRecord[i].oshandle); fflush(fp); fclose(fp); @@ -1835,7 +1836,20 @@ myselect (int nfds, fd_set *rd, fd_set *wr, fd_set *ex, errno = EINTR; break; case WSAENOTSOCK: - errno = EBADF; + // assume normal files are always readable/writable + // fake read/write fd_set and return value + r = 0; + if (rd) r += rd->fd_count; + if (wr) r += wr->fd_count; + if (ex && ex->fd_count > 0) { + // exceptional condition never happen for normal files + if (r > 0) + ex->fd_count = 0; + else { + errno = EBADF; + r = SOCKET_ERROR; + } + } break; } } |