aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-15 17:50:39 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-04-15 17:50:39 +0000
commit6717a057b9903b632baadfa1c570645792a9c07b (patch)
tree1aa785d0028d86fa32e5981eaa440db21b21e351 /scripts
parentca04c9042de024eb559e7841dfce1cf67056a145 (diff)
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/coqc.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/coqc.ml b/scripts/coqc.ml
index 57453ac4d..be20de24a 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 ()