From: Pino Toscano Date: Wed, 13 Sep 2017 16:24:58 +0000 (+0200) Subject: Create a separate raise_init_error function X-Git-Tag: v0.6~29 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=0028d9a106b706ad4e8820a1a7ae5daa023f604f;p=ocaml-augeas.git Create a separate raise_init_error function Used only on init, when there is no augeas pointer available. --- diff --git a/augeas-c.c b/augeas-c.c index c06bf92..6a11e99 100644 --- a/augeas-c.c +++ b/augeas-c.c @@ -38,6 +38,12 @@ raise_error (const char *msg) caml_raise_with_string (*caml_named_value ("Augeas.Error"), msg); } +static void +raise_init_error (const char *msg) +{ + caml_raise_with_string (*caml_named_value ("Augeas.Error"), msg); +} + /* Map OCaml flags to C flags. */ static int flag_map[] = { /* AugSaveBackup */ AUG_SAVE_BACKUP, @@ -111,7 +117,7 @@ ocaml_augeas_create (value rootv, value loadpathv, value flagsv) t = aug_init (root, loadpath, flags); if (t == NULL) - raise_error ("Augeas.create"); + raise_init_error ("Augeas.create"); CAMLreturn (Val_augeas_t (t)); }