Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -Naur ocaml-3.12.1.orig/otherlibs/win32unix/close_on.c ocaml-3.12.1/otherlibs/win32unix/close_on.c
- --- ocaml-3.12.1.orig/otherlibs/win32unix/close_on.c 2001-12-07 13:41:02.000000000 +0000
- +++ ocaml-3.12.1/otherlibs/win32unix/close_on.c 2011-12-08 13:22:34.000000000 +0000
- @@ -19,17 +19,14 @@
- int win_set_inherit(value fd, BOOL inherit)
- {
- - HANDLE oldh, newh;
- -
- - oldh = Handle_val(fd);
- - if (! DuplicateHandle(GetCurrentProcess(), oldh,
- - GetCurrentProcess(), &newh,
- - 0L, inherit, DUPLICATE_SAME_ACCESS)) {
- + /* According to the MSDN, SetHandleInformation may not work
- + for console handles on WinNT4 and earlier versions. */
- + if (! SetHandleInformation(Handle_val(fd),
- + HANDLE_FLAG_INHERIT,
- + inherit ? HANDLE_FLAG_INHERIT : 0)) {
- win32_maperr(GetLastError());
- return -1;
- }
- - Handle_val(fd) = newh;
- - CloseHandle(oldh);
- return 0;
- }
Add Comment
Please, Sign In to add comment