diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-15 05:33:45 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-15 05:33:45 +0000 |
commit | f15d0deaaf1ae0b92c539bd823dd2b00afbaf502 (patch) | |
tree | b127e79147cbb4dbd25369a9ec0d6eb1f10ff52c /win32/win32.c | |
parent | e56f2abe4b775dcee4690ef43cbac71bbce2a5af (diff) |
* win32/win32.c, include/ruby/win32.h (rb_w32_io_cancelable_p): renamed
from rb_w32_has_cancel_io(). now it takes a parameter as fd to check
the fd is console or not, because we cannot cancel console input even
if we have cancel_io function.
* io.c (WAIT_FD_IN_WIN32): call above function instead of the old one,
so now we can kill the thread which calls STDIN.gets.
the problem was reported by ko1 vir IRC.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/win32/win32.c b/win32/win32.c index 4d3080663b..7ec83d9221 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -578,12 +578,6 @@ init_env(void) typedef BOOL (WINAPI *cancel_io_t)(HANDLE); static cancel_io_t cancel_io = NULL; -int -rb_w32_has_cancel_io(void) -{ - return cancel_io != NULL; -} - static void init_func(void) { @@ -2080,6 +2074,12 @@ set_pioinfo_extra(void) #define FDEV 0x40 /* file handle refers to device */ #define FTEXT 0x80 /* file handle is in text mode */ +int +rb_w32_io_cancelable_p(int fd) +{ + return cancel_io != NULL && (is_socket(TO_SOCKET(fd)) || !is_console(TO_SOCKET(fd))); +} + static int rb_w32_open_osfhandle(intptr_t osfhandle, int flags) { |