[Pkg-libvirt-commits] [libguestfs] 184/266: daemon: move AUGEAS_ERROR to the common header

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:59 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit abb0b47e3f1b8b86d2d39c2a91782ac5ed4b134e
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Tue Aug 26 14:39:28 2014 +0200

    daemon: move AUGEAS_ERROR to the common header
    
    Other than for current aug_* API, it will be useful for further code
    using augeas directly.
---
 daemon/augeas.c | 17 -----------------
 daemon/daemon.h | 17 +++++++++++++++++
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/daemon/augeas.c b/daemon/augeas.c
index e31cab4..74f3ba7 100644
--- a/daemon/augeas.c
+++ b/daemon/augeas.c
@@ -55,23 +55,6 @@ aug_finalize (void)
   }									\
   while (0)
 
-/* Calls reply_with_error, but includes the Augeas error details. */
-#define AUGEAS_ERROR(fs,...)                                            \
-  do {                                                                  \
-      int code = aug_error (aug);                                       \
-      if (code == AUG_ENOMEM)                                           \
-        reply_with_error (fs ": augeas out of memory", ##__VA_ARGS__);  \
-      else {                                                            \
-            const char *message = aug_error_message (aug);              \
-            const char *minor = aug_error_minor_message (aug);          \
-            const char *details = aug_error_details (aug);              \
-            reply_with_error (fs ": %s%s%s%s%s", ##__VA_ARGS__,         \
-                                message,                                \
-                                minor ? ": " : "", minor ? minor : "",  \
-                                details ? ": " : "", details ? details : ""); \
-            }                                                           \
-  } while (0)
-
 /* We need to rewrite the root path so it is based at /sysroot. */
 int
 do_aug_init (const char *root, int flags)
diff --git a/daemon/daemon.h b/daemon/daemon.h
index 705aa95..d90b3e7 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -403,6 +403,23 @@ is_zero (const char *buffer, size_t size)
     }                                                   \
     while (0)
 
+/* Calls reply_with_error, but includes the Augeas error details. */
+#define AUGEAS_ERROR(fs,...)                                            \
+  do {                                                                  \
+    int code = aug_error (aug);                                         \
+    if (code == AUG_ENOMEM)                                             \
+      reply_with_error (fs ": augeas out of memory", ##__VA_ARGS__);    \
+    else {                                                              \
+      const char *message = aug_error_message (aug);                    \
+      const char *minor = aug_error_minor_message (aug);                \
+      const char *details = aug_error_details (aug);                    \
+      reply_with_error (fs ": %s%s%s%s%s", ##__VA_ARGS__,               \
+                          message,                                      \
+                          minor ? ": " : "", minor ? minor : "",        \
+                          details ? ": " : "", details ? details : ""); \
+    }                                                                   \
+  } while (0)
+
 #ifdef HAVE_ATTRIBUTE_CLEANUP
 #define CLEANUP_FREE __attribute__((cleanup(cleanup_free)))
 #define CLEANUP_FREE_STRING_LIST                        \

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list