aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/nativelib.ml
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-01-13 10:50:40 +0100
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-01-13 10:53:21 +0100
commit8e06c02845df0f1243ca260c7707cc912734c704 (patch)
tree0fb15e4ce9a91be5807b18020d1fb56cb4b3d4d3 /kernel/nativelib.ml
parent51b2581d027528c8e4a347f157baf51a71b9d613 (diff)
parent245affffb174fb26fc9a847abe44e01b107980a8 (diff)
Merge branch 'v8.5'
Diffstat (limited to 'kernel/nativelib.ml')
-rw-r--r--kernel/nativelib.ml12
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/nativelib.ml b/kernel/nativelib.ml
index 331598d85..b5cfeeba7 100644
--- a/kernel/nativelib.ml
+++ b/kernel/nativelib.ml
@@ -74,7 +74,17 @@ let call_compiler ml_filename =
::include_dirs
@ ["-impl"; ml_filename] in
if !Flags.debug then Pp.msg_debug (Pp.str (ocamlfind () ^ " " ^ (String.concat " " args)));
- try CUnix.sys_command (ocamlfind ()) args = Unix.WEXITED 0, link_filename
+ try
+ let res = CUnix.sys_command (ocamlfind ()) args in
+ let res = match res with
+ | Unix.WEXITED 0 -> true
+ | Unix.WEXITED n ->
+ Pp.(msg_warning (str "command exited with status " ++ int n)); false
+ | Unix.WSIGNALED n ->
+ Pp.(msg_warning (str "command killed by signal " ++ int n)); false
+ | Unix.WSTOPPED n ->
+ Pp.(msg_warning (str "command stopped by signal " ++ int n)); false in
+ res, link_filename
with Unix.Unix_error (e,_,_) ->
Pp.(msg_warning (str (Unix.error_message e)));
false, link_filename