Changes by: Aleksey Nogin (nogin at metaprl.org)
Date: 2007-06-27 12:33:40 -0700 (Wed, 27 Jun 2007)
Revision: 11148
Log message:

      Fixed a nasty hard to debug Windows-specific problem - osh scripts terminated by an "exit" call would always quit with exit code 1, regardless of the actual argument to exit (even if it was "exit 0")!
     
     This was caused by the following:
      - Omake_shell had a local "exit" function that would call Omake_readline.save and Omake_shell_sys.close before calling Pervasives.exit
      - Omake_shell_sys.close is a no-op on Unix, but under Win32 it would proceed to kill all the currently running processes, _including_ itself!
     
     I fixed this by changing the C code not to kill the current process from omake_shell_sys_close.
     
     This commit also adds some debugging code (protected by "if !debug_shell" in ML and by "#ifdef OSH_DEBUG" in C).

Changes  Path
+49 -23 omake-branches/0.9.8.x/src/clib/omake_shell_sys.c
+2 -2 omake-branches/0.9.8.x/src/eval/omake_eval.ml
+13 -1 omake-branches/0.9.8.x/src/main/omake_shell.ml
+4 -0 omake-branches/0.9.8.x/src/shell/omake_shell_job.ml