Displaying 3 results from an estimated 3 matches for "35478f39e".
2019 Mar 28
0
[PATCH v2 3/4] common/mltools: allow fd for machine readable output
...;1 >/dev/null | wc -l) -eq 2
+
+# Output "fd:".
+fn="$tmpdir/fdfile"
+exec 4>"$fn"
+$t --machine-readable=fd:4
+exec 4>&-
+test $(cat "$fn" | wc -l) -eq 1
diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml
index ade4cb37f..35478f39e 100644
--- a/common/mltools/tools_utils.ml
+++ b/common/mltools/tools_utils.ml
@@ -41,6 +41,7 @@ type machine_readable_output_type =
| NoOutput
| Channel of out_channel
| File of string
+ | Fd of int
let machine_readable_output = ref NoOutput
let machine_readable_channel = ref None
let...
2019 Mar 28
8
[PATCH v2 0/4] OCaml tools: output messages as JSON machine
Enhance the output in machine parseable mode, by outputting all the
messages of OCaml tools as JSON to the machine parseable stream.
Related, although not strictly needed for this (and thus can be split
if requested), is the addition of the fd format for the machine
readable stream.
Changes from v1:
- use Obj.magic to convert int -> Unix.file_descr
- add tests
Pino Toscano (4):
2019 Mar 28
0
[PATCH v2 4/4] OCaml tools: output messages into JSON for machine readable
...e timezone minutes one character to the right, moving the
+ * null character too.
+ */
+ memmove (buf + total - 1, buf + total - 2, 3);
+ buf[total - 2] = ':';
+
+ CAMLreturn (caml_copy_string (buf));
+}
diff --git a/common/mltools/tools_utils.ml b/common/mltools/tools_utils.ml
index 35478f39e..de42df600 100644
--- a/common/mltools/tools_utils.ml
+++ b/common/mltools/tools_utils.ml
@@ -32,6 +32,7 @@ and key_store_key =
external c_inspect_decrypt : Guestfs.t -> int64 -> (string * key_store_key) list -> unit = "guestfs_int_mllib_inspect_decrypt"
external c_set_echo_key...