38 lines
1.3 KiB
Diff
38 lines
1.3 KiB
Diff
|
From 68bc5e82e4892f981b1d5409ec217518749c4b61 Mon Sep 17 00:00:00 2001
|
||
|
From: Pino Toscano <ptoscano@redhat.com>
|
||
|
Date: Wed, 17 Sep 2014 12:59:54 +0200
|
||
|
Subject: [PATCH] Use open_process_full in compressed file reading
|
||
|
|
||
|
Since only few bytes of the compressed file are read, closing the stdout
|
||
|
of the process will cause it to complain about that.
|
||
|
Switch to open_process_full instead of open_process_in, so we can close
|
||
|
also stderr and avoid that harmless error message.
|
||
|
---
|
||
|
src/build.ml | 6 +++---
|
||
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
||
|
|
||
|
diff --git a/src/build.ml b/src/build.ml
|
||
|
index 7011731..500ce33 100644
|
||
|
--- a/src/build.ml
|
||
|
+++ b/src/build.ml
|
||
|
@@ -322,13 +322,13 @@ and get_file_content file buf len =
|
||
|
|
||
|
and get_compressed_file_content zcat file =
|
||
|
let cmd = sprintf "%s %s" zcat (quote file) in
|
||
|
- let chan = open_process_in cmd in
|
||
|
+ let chan_out, chan_in, chan_err = open_process_full cmd [||] in
|
||
|
let buf = String.create 512 in
|
||
|
- let len = input chan buf 0 (String.length buf) in
|
||
|
+ let len = input chan_out buf 0 (String.length buf) in
|
||
|
(* We're expecting the subprocess to fail because we close the pipe
|
||
|
* early, so:
|
||
|
*)
|
||
|
- ignore (close_process_in chan);
|
||
|
+ ignore (Unix.close_process_full (chan_out, chan_in, chan_err));
|
||
|
|
||
|
get_file_content file buf len
|
||
|
|
||
|
--
|
||
|
1.9.3
|
||
|
|