[Libguestfs] [PATCH 1/5] mltools: split helper do_check_exitcode

Pino Toscano ptoscano at redhat.com
Wed Jan 16 14:17:31 UTC 2019


It will be used later in more parts of Tools_utils.

Simple refactoring with no behaviour changes.
---
 common/mltools/tools_utils.ml | 4 +++-
 1 file changed, 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




More information about the Libguestfs mailing list