aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2012-05-03 15:42:12 +0400
committerIgor Pashev <pashev.igor@gmail.com>2012-05-03 15:42:12 +0400
commita9d4eb9ba5238c63a3a2d78a7106f54836fe83be (patch)
tree12384792ed67826f4d53b8411bdc854b8b0a5a9f
parentbe250e243fab75b02de8985f9932adb79f1501aa (diff)
downloadnode-augeas-a9d4eb9ba5238c63a3a2d78a7106f54836fe83be.tar.gz
Always use AUG_NO_ERR_CLOSE
-rw-r--r--libaugeas.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/libaugeas.cc b/libaugeas.cc
index 46300e6..f9cc4a5 100644
--- a/libaugeas.cc
+++ b/libaugeas.cc
@@ -244,14 +244,10 @@ Handle<Value> LibAugeas::New(const Arguments& args)
}
}
- obj->m_aug = aug_init(root.c_str(), loadpath.c_str(), flags);
+ obj->m_aug = aug_init(root.c_str(), loadpath.c_str(), flags | AUG_NO_ERR_CLOSE);
- /*
- * If flags have AUG_NO_ERR_CLOSE aug_init() might return non-null
- * augeas handle which can be used to get error code and message.
- */
- if (NULL == obj->m_aug) {
- ThrowException(Exception::Error(String::New("aug_init() failed")));
+ if (NULL == obj->m_aug) { // should not happen
+ ThrowException(Exception::Error(String::New("aug_init() badly failed")));
return scope.Close(Undefined());
} else if (AUG_NOERROR != aug_error(obj->m_aug)) {
throw_aug_error_msg(obj->m_aug);