summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2023-06-01 08:43:22 +0900
committerNARUSE, Yui <naruse@airemix.jp>2023-06-01 08:43:22 +0900
commit85dcc4866d9ff29834596e9186cc97d622ee06f8 (patch)
treed5daa60146c5c8c2de9a9459a05e6e771d934362 /win32
parente4163112f6b99d9c205f6bc260878dcb00954a13 (diff)
Revert "Hide most of the implementation of `struct rb_io`. (#6511)"
This reverts commit 18e55fc1e1ec20e8f3166e3059e76c885fc9f8f2. fix [Bug #19704] https://bugs.ruby-lang.org/issues/19704 This breaks compatibility for extension libraries. Such changes need a discussion.
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index c2d12a79f4..ec65f5383b 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -8269,7 +8269,10 @@ w32_io_info(VALUE *file, w32_io_info_t *st)
tmp = rb_check_convert_type_with_id(*file, T_FILE, "IO", idTo_io);
if (!NIL_P(tmp)) {
- f = (HANDLE)rb_w32_get_osfhandle(rb_io_descriptor(tmp));
+ rb_io_t *fptr;
+
+ GetOpenFile(tmp, fptr);
+ f = (HANDLE)rb_w32_get_osfhandle(fptr->fd);
if (f == (HANDLE)-1) return INVALID_HANDLE_VALUE;
}
else {