summaryrefslogtreecommitdiff
path: root/scripts/coqc.ml
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/coqc.ml')
-rw-r--r--scripts/coqc.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/coqc.ml b/scripts/coqc.ml
index 7185b140..cc8e5a1a 100644
--- a/scripts/coqc.ml
+++ b/scripts/coqc.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: coqc.ml 13323 2010-07-24 15:57:30Z herbelin $ *)
+(* $Id: coqc.ml 14015 2011-04-15 17:48:45Z letouzey $ *)
(* Afin de rendre Coq plus portable, ce programme Caml remplace le script
coqc.
@@ -84,7 +84,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
@@ -196,4 +200,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 ()