diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 1998-10-01 12:38:09 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 1998-10-01 12:38:09 +0000 |
commit | 55668b9dd258e9d2b0777d5cac0d6f450b2394b7 (patch) | |
tree | 7bc35b33c6396282a2e5b3813346728e4486a3f5 | |
parent | 4de5d32abf08229c423af9f83fab65e87268f733 (diff) |
Bien traiter le cas d'un .cmo ou .cma vide (e.g. si disque plein ou utilisateur stupide)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2109 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | bytecomp/bytelibrarian.ml | 6 | ||||
-rw-r--r-- | bytecomp/bytelink.ml | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/bytecomp/bytelibrarian.ml b/bytecomp/bytelibrarian.ml index 7890ee15c..200e0dc14 100644 --- a/bytecomp/bytelibrarian.ml +++ b/bytecomp/bytelibrarian.ml @@ -61,9 +61,9 @@ let copy_object_file oc name = toc end else raise(Error(Not_an_object_file file_name)) - with x -> - close_in ic; - raise x + with + End_of_file -> close_in ic; raise(Error(Not_an_object_file file_name)) + | x -> close_in ic; raise x let create_archive file_list lib_name = let outchan = open_out_bin lib_name in diff --git a/bytecomp/bytelink.ml b/bytecomp/bytelink.ml index 5537a2ca9..20d930768 100644 --- a/bytecomp/bytelink.ml +++ b/bytecomp/bytelink.ml @@ -107,8 +107,9 @@ let scan_file obj_name tolink = Link_archive(file_name, required) :: tolink end else raise(Error(Not_an_object_file file_name)) - with x -> - close_in ic; raise x + with + End_of_file -> close_in ic; raise(Error(Not_an_object_file file_name)) + | x -> close_in ic; raise x (* Second pass: link in the required units *) |