libguestfs/0001-Revert-daemon-augeas-Don-t-test-if-AUG_NO_ERR_CLOSE-.patch

45 lines
1.1 KiB
Diff

From 3a50219454e12b9bc3524b282cb11cfc207d63b0 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Fri, 18 Oct 2013 14:57:34 +0100
Subject: Revert "daemon: augeas: Don't test if AUG_NO_ERR_CLOSE is defined."
This reverts commit f59b87f7f18d9df89ff9940a317ff1fb452cbd28.
See:
https://www.redhat.com/archives/libguestfs/2013-October/msg00035.html
---
daemon/augeas.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/daemon/augeas.c b/daemon/augeas.c
index 45338da..9d6a553 100644
--- a/daemon/augeas.c
+++ b/daemon/augeas.c
@@ -98,20 +98,26 @@ do_aug_init (const char *root, int flags)
return -1;
}
+#ifdef AUG_NO_ERR_CLOSE
/* Pass AUG_NO_ERR_CLOSE so we can display detailed errors. */
aug = aug_init (buf, NULL, flags | AUG_NO_ERR_CLOSE);
+#else
+ aug = aug_init (buf, NULL, flags);
+#endif
if (!aug) {
reply_with_error ("augeas initialization failed");
return -1;
}
+#ifdef AUG_NO_ERR_CLOSE
if (aug_error (aug) != AUG_NOERROR) {
AUGEAS_ERROR ("aug_init: %s (flags %d)", root, flags);
aug_close (aug);
aug = NULL;
return -1;
}
+#endif
return 0;
}