Skip to content

Commit

Permalink
Merge branch 'master' of github.com:OCamlPro/opam
Browse files Browse the repository at this point in the history
  • Loading branch information
tuong committed Jun 25, 2012
2 parents e9abc65 + f13ff92 commit d5055fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/process.ml
Expand Up @@ -31,14 +31,15 @@ let create ?info ?stdout ?stderr ?env cmd args =
let nothing () = () in
let tee f =
let fd = Unix.openfile f open_flags 0o644 in
let close_fd () = Unix.close fd in
if !Globals.debug || !Globals.verbose then (
let chan = Unix.open_process_out ("tee " ^ f) in
let close () =
match Unix.close_process_out chan with
| _ -> () in
| _ -> close_fd () in
Unix.descr_of_out_channel chan, close
) else
fd, nothing in
fd, close_fd in
let stdout_fd, close_stdout = match stdout with
| None -> Unix.stdout, nothing
| Some f -> tee f in
Expand Down
2 changes: 1 addition & 1 deletion src/run.ml
Expand Up @@ -209,7 +209,7 @@ let run_process ?(add_to_env=[]) ?(add_to_path=[]) = function
Globals.error "Command %S failed (see %s.{info,err,out})" str name;
List.iter (Globals.msg "%s\n") r.Process.r_stdout;
List.iter (Globals.msg "%s\n") r.Process.r_stderr;
Globals.exit 1
Globals.exit r.Process.r_code
) else if not !Globals.debug then
Process.clean_files r;
r
Expand Down

0 comments on commit d5055fd

Please sign in to comment.