Displaying 3 results from an estimated 3 matches for "7395de923".
2017 Nov 07
0
[PATCH] common/mlstdutils: Add with_openfile function.
...either on
+ normal return or if the function [f] throws an exception, so this
+ is both safer and more concise than the regular function. *)
+
val read_whole_file : string -> string
(** Read in the whole file as a string. *)
diff --git a/daemon/devsparts.ml b/daemon/devsparts.ml
index 7395de923..0eb7c1282 100644
--- a/daemon/devsparts.ml
+++ b/daemon/devsparts.ml
@@ -49,9 +49,8 @@ let map_block_devices ~return_md f =
List.filter (
fun dev ->
try
- let fd = openfile ("/dev/" ^ dev) [O_RDONLY; O_CLOEXEC] 0 in
- close fd;
- true
+...
2017 Nov 05
0
[PATCH 2/2] common/mlstdutils: Add with_openfile function.
...either on
+ normal return or if the function [f] throws an exception, so this
+ is both safer and more concise than the regular function. *)
+
val read_whole_file : string -> string
(** Read in the whole file as a string. *)
diff --git a/daemon/devsparts.ml b/daemon/devsparts.ml
index 7395de923..0eb7c1282 100644
--- a/daemon/devsparts.ml
+++ b/daemon/devsparts.ml
@@ -49,9 +49,8 @@ let map_block_devices ~return_md f =
List.filter (
fun dev ->
try
- let fd = openfile ("/dev/" ^ dev) [O_RDONLY; O_CLOEXEC] 0 in
- close fd;
- true
+...
2017 Nov 05
3
[PATCH 1/2] common/mlstdutils: Add with_open_in and with_open_out functions.
These safe wrappers around Pervasives.open_in and Pervasives.open_out
ensure that exceptions escaping cannot leave unclosed files.
---
common/mlstdutils/std_utils.ml | 39 ++++++++++++++++++++--------------
common/mlstdutils/std_utils.mli | 12 +++++++++++
common/mltools/tools_utils.ml | 39 +++++++++++++++++-----------------
dib/dib.ml | 9 ++++----