diff options
author | Nicolas Pouillard <np@nicolaspouillard.fr> | 2008-11-06 15:40:39 +0000 |
---|---|---|
committer | Nicolas Pouillard <np@nicolaspouillard.fr> | 2008-11-06 15:40:39 +0000 |
commit | 901e3bfa82714a0995e4649ec8aea54a0000ca48 (patch) | |
tree | 0291cbdff50529853a3016e6f4d942475e7576fd | |
parent | 526df2771ce71427a2a6feb72991165a98f4e26b (diff) |
ocamlbuild: close the log file when cleanning and lauching the plugin.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9118 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | ocamlbuild/display.ml | 5 | ||||
-rw-r--r-- | ocamlbuild/main.ml | 1 | ||||
-rw-r--r-- | ocamlbuild/plugin.ml | 1 |
3 files changed, 5 insertions, 2 deletions
diff --git a/ocamlbuild/display.ml b/ocamlbuild/display.ml index 576f2c490..9923acaf5 100644 --- a/ocamlbuild/display.ml +++ b/ocamlbuild/display.ml @@ -61,7 +61,7 @@ type display_line = type display = { di_log_level : int; - di_log_channel : (Format.formatter * out_channel) option; + mutable di_log_channel : (Format.formatter * out_channel) option; di_channel : out_channel; di_formatter : Format.formatter; di_display_line : display_line; @@ -274,7 +274,8 @@ let finish ?(how=`Success) di = call_if di.di_log_channel begin fun (fmt, oc) -> Format.fprintf fmt "# Compilation %ssuccessful.@." (if how = `Error then "un" else ""); - close_out oc + close_out oc; + di.di_log_channel <- None end; match di.di_display_line with | Classic -> () diff --git a/ocamlbuild/main.ml b/ocamlbuild/main.ml index dbeb879c1..852d5614a 100644 --- a/ocamlbuild/main.ml +++ b/ocamlbuild/main.ml @@ -24,6 +24,7 @@ exception Exit_build_error of string exception Exit_silently let clean () = + Log.finish (); Shell.rm_rf !Options.build_dir; if !Options.make_links then begin let entry = diff --git a/ocamlbuild/plugin.ml b/ocamlbuild/plugin.ml index d72b92049..f237d7af5 100644 --- a/ocamlbuild/plugin.ml +++ b/ocamlbuild/plugin.ml @@ -98,6 +98,7 @@ module Make(U:sig end) = if not !Options.just_plugin then let spec = S[!Options.ocamlrun; P(!Options.build_dir/plugin); A"-no-plugin"; atomize (List.tl (Array.to_list Sys.argv))] in + let () = Log.finish () in raise (Exit_silently_with_code (sys_command (Command.string_of_command_spec spec))) end else |