[Libguestfs] [PATCH nbdkit 5/9 patch split 3/5] server: Move some definitions in server/internal.h to the top of the file.

Richard W.M. Jones rjones at redhat.com
Thu Mar 26 20:13:21 UTC 2020


Makes the file ordering more logical, but otherwise no effect.
---
 server/internal.h | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/server/internal.h b/server/internal.h
index a1db231e..d412e500 100644
--- a/server/internal.h
+++ b/server/internal.h
@@ -80,11 +80,25 @@
 # define DO_DLCLOSE 1
 #endif
 
+/* Declare program_name. */
+#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1
+#include <errno.h>
+#define program_name program_invocation_short_name
+#else
+#define program_name "nbdkit"
+#endif
+
 #define container_of(ptr, type, member) ({                       \
       const typeof (((type *) 0)->member) *__mptr = (ptr);       \
       (type *) ((char *) __mptr - offsetof(type, member));       \
     })
 
+#define debug(fs, ...)                                   \
+  do {                                                   \
+    if_verbose                                           \
+      nbdkit_debug ((fs), ##__VA_ARGS__);                \
+  } while (0)
+
 /* Maximum read or write request that we will handle. */
 #define MAX_REQUEST_SIZE (64 * 1024 * 1024)
 
@@ -286,13 +300,6 @@ extern void crypto_init (bool tls_set_on_cli);
 extern void crypto_free (void);
 extern int crypto_negotiate_tls (int sockin, int sockout);
 
-/* debug.c */
-#define debug(fs, ...)                                   \
-  do {                                                   \
-    if_verbose                                           \
-      nbdkit_debug ((fs), ##__VA_ARGS__);                \
-  } while (0)
-
 /* debug-flags.c */
 extern void add_debug_flag (const char *arg);
 extern void apply_debug_flags (void *dl, const char *name);
@@ -517,12 +524,4 @@ extern struct connection *threadlocal_get_conn (void);
   struct connection *conn = threadlocal_get_conn ();    \
   assert (conn != NULL)
 
-/* Declare program_name. */
-#if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME == 1
-#include <errno.h>
-#define program_name program_invocation_short_name
-#else
-#define program_name "nbdkit"
-#endif
-
 #endif /* NBDKIT_INTERNAL_H */
-- 
2.25.0




More information about the Libguestfs mailing list