[Libguestfs] [PATCH nbdkit 3/9] server: Add log_verror function.

Richard W.M. Jones rjones at redhat.com
Thu Mar 26 18:25:28 UTC 2020


Apart from removing a slightly misleading comment, this small
refactoring makes subsequent commits simpler but otherwise doesn't
change anything.
---
 server/internal.h |  3 +++
 server/log.c      | 15 ++++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/server/internal.h b/server/internal.h
index e5c7f514..b43798ff 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -297,6 +297,9 @@ extern void add_debug_flag (const char *arg);
 extern void apply_debug_flags (void *dl, const char *name);
 extern void free_debug_flags (void);
 
+/* log.c */
+extern void log_verror (const char *fs, va_list args);
+
 /* log-*.c */
 extern void log_stderr_verror (const char *fs, va_list args)
   __attribute__((__format__ (printf, 1, 0)));
diff --git a/server/log.c b/server/log.c
index 73493563..37de3dd2 100644
--- a/server/log.c
+++ b/server/log.c
@@ -40,11 +40,11 @@
 
 #include "internal.h"
 
-/* Call the right nbdkit_verror function depending on log_sink.
+/* Call the right log_*_verror function depending on log_sink.
  * Note: preserves the previous value of errno.
  */
 void
-nbdkit_verror (const char *fs, va_list args)
+log_verror (const char *fs, va_list args)
 {
   switch (log_to) {
   case LOG_TO_DEFAULT:
@@ -65,9 +65,14 @@ nbdkit_verror (const char *fs, va_list args)
   }
 }
 
-/* Wrapper around nbdkit_verror.
- * Note: preserves the previous value of errno.
- */
+/* Note: preserves the previous value of errno. */
+void
+nbdkit_verror (const char *fs, va_list args)
+{
+  log_verror (fs, args);
+}
+
+/* Note: preserves the previous value of errno. */
 void
 nbdkit_error (const char *fs, ...)
 {
-- 
2.25.0




More information about the Libguestfs mailing list