diff options
author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2014-05-18 16:08:38 +0000 |
---|---|---|
committer | Gabriel Scherer <gabriel.scherer@gmail.com> | 2014-05-18 16:08:38 +0000 |
commit | 34fb0d4345d1f842234a01808a366a19bd6c4c74 (patch) | |
tree | e5e5a0b405e6a8e48dba54eca800785c2c644ed0 | |
parent | a5e4f0631cf3007537d0c09f706820428930bf43 (diff) |
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
-rw-r--r-- | ocamlbuild/ocamlbuild_executor.ml | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/ocamlbuild/ocamlbuild_executor.ml b/ocamlbuild/ocamlbuild_executor.ml index 0941b026d..298f9b4dd 100644 --- a/ocamlbuild/ocamlbuild_executor.ml +++ b/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); |