From b7741f0a831ef9dfd4fda19abba6ca8e91baa378 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 17 Apr 2014 10:40:35 +0200 Subject: [PATCH] libdaemon: header cleanup Ensure daemon-io.h is used as a generic header included with configure defines before other headers. (In future all lvm2 libraries should settle on a single lib.h header) Rename couple defines to better match header file names. --- libdaemon/client/config-util.c | 7 +++---- libdaemon/client/config-util.h | 3 +-- libdaemon/client/daemon-client.c | 2 -- libdaemon/client/daemon-client.h | 4 ++-- libdaemon/client/daemon-io.c | 6 +++--- libdaemon/client/daemon-io.h | 6 +++--- libdaemon/server/daemon-server.c | 1 - libdaemon/server/daemon-server.h | 4 ++-- 8 files changed, 14 insertions(+), 19 deletions(-) diff --git a/libdaemon/client/config-util.c b/libdaemon/client/config-util.c index d40e94c58..e5f4e2205 100644 --- a/libdaemon/client/config-util.c +++ b/libdaemon/client/config-util.c @@ -12,15 +12,14 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "daemon-io.h" +#include "dm-logging.h" + #include #include #include #include -#include "dm-logging.h" -#include "config-util.h" -#include "libdevmapper.h" - int buffer_append_vf(struct buffer *buf, va_list ap) { char *append; diff --git a/libdaemon/client/config-util.h b/libdaemon/client/config-util.h index f03bcabaf..47fab6bcb 100644 --- a/libdaemon/client/config-util.h +++ b/libdaemon/client/config-util.h @@ -15,7 +15,6 @@ #ifndef _LVM_DAEMON_CONFIG_UTIL_H #define _LVM_DAEMON_CONFIG_UTIL_H -#include "configure.h" #include "libdevmapper.h" #include @@ -64,4 +63,4 @@ struct dm_config_node *config_make_nodes(struct dm_config_tree *cft, struct dm_config_node *pre_sib, ...); -#endif /* _LVM_DAEMON_SHARED_H */ +#endif /* _LVM_DAEMON_CONFIG_UTIL_H */ diff --git a/libdaemon/client/daemon-client.c b/libdaemon/client/daemon-client.c index a821cf38b..a11b60448 100644 --- a/libdaemon/client/daemon-client.c +++ b/libdaemon/client/daemon-client.c @@ -13,7 +13,6 @@ */ #include "daemon-io.h" -#include "config-util.h" #include "daemon-client.h" #include "dm-logging.h" @@ -208,4 +207,3 @@ void daemon_request_destroy(daemon_request r) { dm_config_destroy(r.cft); buffer_destroy(&r.buffer); } - diff --git a/libdaemon/client/daemon-client.h b/libdaemon/client/daemon-client.h index 8a44f8b71..ae3be9187 100644 --- a/libdaemon/client/daemon-client.h +++ b/libdaemon/client/daemon-client.h @@ -12,8 +12,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _LVM_DAEMON_COMMON_CLIENT_H -#define _LVM_DAEMON_COMMON_CLIENT_H +#ifndef _LVM_DAEMON_CLIENT_H +#define _LVM_DAEMON_CLIENT_H #include "libdevmapper.h" #include "config-util.h" diff --git a/libdaemon/client/daemon-io.c b/libdaemon/client/daemon-io.c index e2c51800a..6d81ed86e 100644 --- a/libdaemon/client/daemon-io.c +++ b/libdaemon/client/daemon-io.c @@ -12,14 +12,14 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "daemon-io.h" +#include "libdevmapper.h" + #include #include #include #include -#include "daemon-io.h" -#include "libdevmapper.h" - /* * Read a single message from a (socket) filedescriptor. Messages are delimited * by blank lines. This call will block until all of a message is received. The diff --git a/libdaemon/client/daemon-io.h b/libdaemon/client/daemon-io.h index 52aaa9cf0..b48accac0 100644 --- a/libdaemon/client/daemon-io.h +++ b/libdaemon/client/daemon-io.h @@ -16,16 +16,16 @@ #define _LVM_DAEMON_IO_H #include "configure.h" -#include "config-util.h" -#include "libdevmapper.h" #define _REENTRANT #define _GNU_SOURCE #define _FILE_OFFSET_BITS 64 +#include "config-util.h" + /* TODO function names */ int buffer_read(int fd, struct buffer *buffer); int buffer_write(int fd, const struct buffer *buffer); -#endif /* _LVM_DAEMON_SHARED_H */ +#endif /* _LVM_DAEMON_IO_H */ diff --git a/libdaemon/server/daemon-server.c b/libdaemon/server/daemon-server.c index 914b8034f..919f7df8d 100644 --- a/libdaemon/server/daemon-server.c +++ b/libdaemon/server/daemon-server.c @@ -11,7 +11,6 @@ */ #include "daemon-io.h" -#include "config-util.h" #include "daemon-server.h" #include "daemon-log.h" diff --git a/libdaemon/server/daemon-server.h b/libdaemon/server/daemon-server.h index eb6df4345..ad413722e 100644 --- a/libdaemon/server/daemon-server.h +++ b/libdaemon/server/daemon-server.h @@ -12,8 +12,8 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _LVM_DAEMON_COMMON_SERVER_H -#define _LVM_DAEMON_COMMON_SERVER_H +#ifndef _LVM_DAEMON_SERVER_H +#define _LVM_DAEMON_SERVER_H #include "daemon-client.h"