diff options
Diffstat (limited to 'otherlibs/win32unix/channels.c')
-rw-r--r-- | otherlibs/win32unix/channels.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/otherlibs/win32unix/channels.c b/otherlibs/win32unix/channels.c index d8160c1fc..196181963 100644 --- a/otherlibs/win32unix/channels.c +++ b/otherlibs/win32unix/channels.c @@ -21,8 +21,10 @@ static int open_descr_flags[10] = { value win_fd_handle(value handle, value flags) /* ML */ { - return Val_int(_open_osfhandle(Handle_val(handle), - convert_flag_list(open_descr_flags, flags))); + int fd = _open_osfhandle((long) Handle_val(handle), + convert_flag_list(open_descr_flags, flags)); + if (fd == -1) uerror("channel_of_descr", Nothing); + return Val_int(fd); } value win_handle_fd(value fd) /* ML */ |