git.annexia.org
/
ocaml-augeas.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d4400e
)
Raise Out_of_memory when Augeas fails with AUG_ENOMEM
author
Pino Toscano
<ptoscano@redhat.com>
Wed, 13 Sep 2017 16:25:00 +0000
(18:25 +0200)
committer
Richard W.M. Jones
<rjones@redhat.com>
Wed, 13 Sep 2017 16:56:43 +0000
(17:56 +0100)
This is more in style with what OCaml reports in this kind of
situations.
augeas-c.c
patch
|
blob
|
history
diff --git
a/augeas-c.c
b/augeas-c.c
index
7ca7244
..
5c330a8
100644
(file)
--- a/
augeas-c.c
+++ b/
augeas-c.c
@@
-35,6
+35,11
@@
typedef augeas *augeas_t;
static void
raise_error (augeas_t t, const char *msg)
{
+ const int code = aug_error (t);
+
+ if (code == AUG_ENOMEM)
+ caml_raise_out_of_memory ();
+
caml_raise_with_string (*caml_named_value ("Augeas.Error"), msg);
}