summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/channels.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/channels.c')
-rw-r--r--otherlibs/win32unix/channels.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/otherlibs/win32unix/channels.c b/otherlibs/win32unix/channels.c
index ed961910b..6e6b10139 100644
--- a/otherlibs/win32unix/channels.c
+++ b/otherlibs/win32unix/channels.c
@@ -82,7 +82,10 @@ CAMLprim value win_filedescr_of_channel(value vchan)
CAMLprim value win_handle_fd(value vfd)
{
int crt_fd = Int_val(vfd);
- value res = win_alloc_handle_or_socket((HANDLE) _get_osfhandle(crt_fd));
+ /* PR#4750: do not use the _or_socket variant as it can cause performance
+ degradation and this function is only used with the standard
+ handles 0, 1, 2, which are not sockets. */
+ value res = win_alloc_handle((HANDLE) _get_osfhandle(crt_fd));
CRT_fd_val(res) = crt_fd;
return res;
}