From 6717a057b9903b632baadfa1c570645792a9c07b Mon Sep 17 00:00:00 2001 From: letouzey Date: Fri, 15 Apr 2011 17:50:39 +0000 Subject: Coqc: fix the exit code Patch suggested by Benjamin Monate git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14016 85f007b7-540e-0410-9357-904b9bb8a0f7 --- scripts/coqc.ml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/coqc.ml b/scripts/coqc.ml index 57453ac4d7..be20de24ab 100644 --- a/scripts/coqc.ml +++ b/scripts/coqc.ml @@ -82,7 +82,11 @@ let compile command args files = Unix.create_process_env command (Array.of_list args') environment Unix.stdin Unix.stdout Unix.stderr in - ignore (Unix.waitpid [] pid) + let status = snd (Unix.waitpid [] pid) in + let errcode = + match status with Unix.WEXITED c|Unix.WSTOPPED c|Unix.WSIGNALED c -> c + in + exit errcode | _ -> Unix.execvpe command (Array.of_list args') environment @@ -192,4 +196,4 @@ let main () = (* List.iter (compile coqtopname args) cfiles*) Unix.handle_unix_error (compile coqtopname args) cfiles -let _ = Printexc.print main (); exit 0 +let _ = Printexc.print main () -- cgit v1.2.3