Displaying 7 results from an estimated 7 matches for "do_teardown".
2017 Jun 20
2
[PATCH v2 1/2] mllib: add new Common_utils.run_commands
...pids =
+ List.partition (
+ fun (_, p, _, _, _) ->
+ pid = p
+ ) !pids in
+ if matching_pair <> [] then (
+ let matching_pair = List.hd matching_pair in
+ let idx, _, app, outfd, errfd = matching_pair in
+ pids := new_pids;
+ res.(idx) <- do_teardown app outfd errfd stat
+ );
+ done;
+ Array.to_list res
+
+and run_command ?(echo_cmd = true) ?stdout_chan ?stderr_chan args =
+ let run_res = do_run args ~echo_cmd ?stdout_chan ?stderr_chan in
+ match run_res with
+ | Either (pid, app, outfd, errfd) ->
+ let _, stat = Unix.waitpid [] p...
2019 Jan 16
0
[PATCH 1/5] mltools: split helper do_check_exitcode
...d, 3 insertions(+), 1 deletion(-)
diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml
index 24641369e..3b1554c5a 100644
--- a/common/mltools/tools_utils.ml
+++ b/common/mltools/tools_utils.ml
@@ -427,7 +427,9 @@ and do_run ?(echo_cmd = true) ?stdout_fd ?stderr_fd args =
and do_teardown app outfd errfd exitstat =
Option.may Unix.close outfd;
Option.may Unix.close errfd;
- match exitstat with
+ do_check_exitcode app exitstat
+
+and do_check_exitcode app = function
| Unix.WEXITED i ->
i
| Unix.WSIGNALED i ->
--
2.20.1
2018 Nov 19
2
[PATCH] common/mltools: Add a debug statement when we try to run a non-existent program.
...| Unix.Unix_error (errcode, _, _) when errcode = Unix.ENOENT ->
- Or 127
+ debug "%s: executable not found" app;
+ Or 127
+ | Unix.Unix_error (errcode, fn, _) when errcode = Unix.ENOENT ->
+ debug "%s: %s: executable not found" app fn;
+ Or 127
and do_teardown app outfd errfd exitstat =
Option.may Unix.close outfd;
--
2.19.0.rc0
2019 Jan 16
10
[PATCH 0/5] [RFC] builder: handle unavailable repos
In case a repository of virt-builder references files (e.g. the index)
that cannot be downloaded (network issues, 404, etc) then virt-builder
errors out on this situation. This is not a nice situation, from an user
POV.
This series does some refactoring to allow to better handle downloading
failures, and handle the failures gracefully in virt-builder.
RFC because I'm not yet too convinced
2017 Oct 08
0
[PATCH v2 3/4] common/mlstdutils: Introduce Option submodule.
...if verbose () then g#set_verbose true;
- may g#set_identifier identifier;
+ Option.may g#set_identifier identifier;
g
(* All the OCaml virt-* programs use this wrapper to catch exceptions
@@ -340,8 +340,8 @@ and do_run ?(echo_cmd = true) ?stdout_chan ?stderr_chan args =
Or 127
and do_teardown app outfd errfd exitstat =
- may Unix.close outfd;
- may Unix.close errfd;
+ Option.may Unix.close outfd;
+ Option.may Unix.close errfd;
match exitstat with
| Unix.WEXITED i ->
i
diff --git a/customize/customize_main.ml b/customize/customize_main.ml
index f6ffc872d..8ba4f5ce7 1006...
2017 Oct 08
4
[PATCH 0/3] common/mlstdutils: Add Std_utils List and Option modules.
In Std_utils we already extend Char and String. These commits take it
a little further by extending List and adding a new Option submodule.
All basically simple refactoring.
Rich.
2017 Oct 08
7
[[PATCH v2 0/4] common/mlstdutils: Add Std_utils List and Option modules.
This time including the first commit ...