Commit a3b4d886 authored by Johannes Kanig's avatar Johannes Kanig

tentative fix for redirect

parent b43ca104
...@@ -295,6 +295,7 @@ let gen_id = ...@@ -295,6 +295,7 @@ let gen_id =
type save_data = type save_data =
{ vc_file : string; { vc_file : string;
is_temporary : bool; is_temporary : bool;
redirect : bool;
limit : resource_limit; limit : resource_limit;
res_parser : prover_result_parser; res_parser : prover_result_parser;
printer_mapping : Printer.printer_mapping; printer_mapping : Printer.printer_mapping;
...@@ -303,7 +304,8 @@ type save_data = ...@@ -303,7 +304,8 @@ type save_data =
let regexs : (int, save_data) Hashtbl.t = Hashtbl.create 17 let regexs : (int, save_data) Hashtbl.t = Hashtbl.create 17
let prove_file_server ~res_parser ~command ~limit let prove_file_server ~res_parser ~command ~limit
~printer_mapping ?(inplace=false) ?(interactive=false) ~printer_mapping ?(redirect=true)
?(inplace=false) ?(interactive=false)
file = file =
let id = gen_id () in let id = gen_id () in
let cmd, _, _ = let cmd, _, _ =
...@@ -312,6 +314,7 @@ let prove_file_server ~res_parser ~command ~limit ...@@ -312,6 +314,7 @@ let prove_file_server ~res_parser ~command ~limit
{ vc_file = file; { vc_file = file;
is_temporary = not inplace; is_temporary = not inplace;
limit = limit; limit = limit;
redirect = redirect;
res_parser = res_parser; res_parser = res_parser;
printer_mapping = printer_mapping } in printer_mapping = printer_mapping } in
Hashtbl.add regexs id saved_data; Hashtbl.add regexs id saved_data;
...@@ -343,6 +346,7 @@ let handle_answer answer = ...@@ -343,6 +346,7 @@ let handle_answer answer =
if save.is_temporary then if save.is_temporary then
Sys.remove save.vc_file; Sys.remove save.vc_file;
let out = read_and_delete_file answer.Prove_client.out_file in let out = read_and_delete_file answer.Prove_client.out_file in
let out = if save.redirect then out else "" in
let ret = Unix.WEXITED answer.Prove_client.exit_code in let ret = Unix.WEXITED answer.Prove_client.exit_code in
let printer_mapping = save.printer_mapping in let printer_mapping = save.printer_mapping in
let ans = let ans =
...@@ -369,7 +373,7 @@ let call_on_file ~command ~limit ~res_parser ~printer_mapping ...@@ -369,7 +373,7 @@ let call_on_file ~command ~limit ~res_parser ~printer_mapping
?(redirect=true) fin = ?(redirect=true) fin =
fun () -> fun () ->
prove_file_server ~res_parser ~command ~limit ~printer_mapping prove_file_server ~res_parser ~command ~limit ~printer_mapping
~inplace ~interactive fin ~redirect ~inplace ~interactive fin
let get_new_results ~blocking = let get_new_results ~blocking =
List.iter (fun (id, r) -> Hashtbl.add result_buffer id r) List.iter (fun (id, r) -> Hashtbl.add result_buffer id r)
......
...@@ -191,6 +191,7 @@ val prove_file_server : ...@@ -191,6 +191,7 @@ val prove_file_server :
command : string -> command : string ->
limit : resource_limit -> limit : resource_limit ->
printer_mapping : Printer.printer_mapping -> printer_mapping : Printer.printer_mapping ->
?redirect : bool ->
?inplace : bool -> ?inplace : bool ->
?interactive : bool -> ?interactive : bool ->
string -> server_id string -> server_id
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment