Gitweb:
http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=e607e0546b5c99c706eb9988824a9612d6f2108b
Commit: e607e0546b5c99c706eb9988824a9612d6f2108b
Parent: 432879633ca382c6d613b39e7a95730bd26d5901
Author: David Lutterkort <[email protected]>
AuthorDate: Fri Jun 12 15:43:15 2009 -0700
Committer: David Lutterkort <[email protected]>
CommitterDate: Mon Sep 21 15:37:15 2009 -0700
* src/syntax.c (interpreter_init): report errors
---
src/syntax.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/syntax.c b/src/syntax.c
index fd8b472..014bfb6 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1943,11 +1943,18 @@ int interpreter_init(struct augeas *aug) {
while ((dir = argz_next(aug->modpathz, aug->nmodpath, dir)) != NULL) {
char *globpat;
r = asprintf(&globpat, "%s/*.aug", dir);
- if (r == -1)
- return -1;
+ ERR_NOMEM(r < 0, aug);
+
r = glob(globpat, gl_flags, NULL, &globbuf);
- if (r != 0 && r != GLOB_NOMATCH)
- FIXME("glob failure for %s", globpat);
+ if (r != 0 && r != GLOB_NOMATCH) {
+ /* This really has to be an allocation failure; glob is not
+ * supposed to return GLOB_ABORTED here */
+ aug_errcode_t code =
+ r == GLOB_NOSPACE ? AUG_ENOMEM : AUG_EINTERNAL;
+ ERR_REPORT(aug, code, "glob failure for %s", globpat);
+ free(globpat);
+ goto error;
+ }
gl_flags |= GLOB_APPEND;
free(globpat);
}
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel