summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2012-06-04 15:53:09 +0000
committerAlain Frisch <alain@frisch.fr>2012-06-04 15:53:09 +0000
commit2b9aa7ef4a1a0aedf3c3eaa4c22e324e93e0bae6 (patch)
tree8c471535a531f56d2379c499c8f627534505fa2f
parentba78c3aa133629fa000f2e8cd359e585b3ca2f93 (diff)
downloadocaml-attributes.tar.gz
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/attributes@12563 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--driver/pparse.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/driver/pparse.ml b/driver/pparse.ml
index ac5f4d6502..367028700b 100644
--- a/driver/pparse.ml
+++ b/driver/pparse.ml
@@ -51,7 +51,7 @@ let rewrite_ast magic ast ppx =
(* TODO: be more clever, and do not read/write intermediate files
when several ppx processors are chained. *)
let fn_in = Filename.temp_file "camlppx_in" "" in
- let fn_out = Filename.temp_file "camlppx_in" "" in
+ let fn_out = Filename.temp_file "camlppx_out" "" in
let oc = open_out_bin fn_in in
output_string oc magic;
output_value oc !Location.input_name;
@@ -59,8 +59,9 @@ let rewrite_ast magic ast ppx =
close_out oc;
let comm = Printf.sprintf "%s %s %s" ppx (Filename.quote fn_in) (Filename.quote fn_out) in
+ let ok = Ccomp.command comm = 0 in
Misc.remove_file fn_in;
- if Ccomp.command comm <> 0 then begin
+ if not ok then begin
Misc.remove_file fn_out;
raise Error;
end;