Guest User

Untitled

a guest
Feb 16th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. diff -Naur ocaml-3.12.1.orig/otherlibs/win32unix/close_on.c ocaml-3.12.1/otherlibs/win32unix/close_on.c
  2. --- ocaml-3.12.1.orig/otherlibs/win32unix/close_on.c 2001-12-07 13:41:02.000000000 +0000
  3. +++ ocaml-3.12.1/otherlibs/win32unix/close_on.c 2011-12-08 13:22:34.000000000 +0000
  4. @@ -19,17 +19,14 @@
  5.  
  6. int win_set_inherit(value fd, BOOL inherit)
  7. {
  8. - HANDLE oldh, newh;
  9. -
  10. - oldh = Handle_val(fd);
  11. - if (! DuplicateHandle(GetCurrentProcess(), oldh,
  12. - GetCurrentProcess(), &newh,
  13. - 0L, inherit, DUPLICATE_SAME_ACCESS)) {
  14. + /* According to the MSDN, SetHandleInformation may not work
  15. + for console handles on WinNT4 and earlier versions. */
  16. + if (! SetHandleInformation(Handle_val(fd),
  17. + HANDLE_FLAG_INHERIT,
  18. + inherit ? HANDLE_FLAG_INHERIT : 0)) {
  19. win32_maperr(GetLastError());
  20. return -1;
  21. }
  22. - Handle_val(fd) = newh;
  23. - CloseHandle(oldh);
  24. return 0;
  25. }
Add Comment
Please, Sign In to add comment