Permalink
Browse files

PR#5371: a partial patch by Edwin Török to fix the FreeBSD failure

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14891 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information...
1 parent a5e4f06 commit 34fb0d4345d1f842234a01808a366a19bd6c4c74 @gasche gasche committed May 18, 2014
Showing with 10 additions and 1 deletion.
  1. +10 −1 ocamlbuild/ocamlbuild_executor.ml
View
11 ocamlbuild/ocamlbuild_executor.ml
@@ -198,7 +198,11 @@ let execute
try
read fd u 0 (Bytes.length u)
with
- | Unix.Unix_error(_,_,_) -> 0
+ | Unix.Unix_error(e,_,_) ->
+ let msg = error_message e in
+ display (fun oc -> fp oc
+ "Error while reading stdout/stderr: %s\n" msg);
+ 0
in
if m = 0 then
if job.job_dying then
@@ -234,6 +238,11 @@ let execute
(*display begin fun oc -> fp oc "Terminating job %a\n%!" print_job_id job.job_id; end;*)
decr jobs_active;
+
+ (* PR#5371: we would get EAGAIN below otherwise *)
+ clear_nonblock (doi job.job_stdout);
+ clear_nonblock (doi job.job_stderr);
+
do_read ~loop:true (doi job.job_stdout) job;
do_read ~loop:true (doi job.job_stderr) job;
outputs := FDM.remove (doi job.job_stdout) (FDM.remove (doi job.job_stderr) !outputs);

0 comments on commit 34fb0d4

Please sign in to comment.