summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-10-13 20:57:59 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-10-13 20:59:35 +0200
commitccc39be053b9a186abc6a020f516ff5f425981d6 (patch)
tree961417580f86c5329f64b30c86cc078206ffc453
parent0cf787a377548394f4588b671c2890ee1a45098b (diff)
downloadlvm2-ccc39be053b9a186abc6a020f516ff5f425981d6.tar.gz
dmeventd: compilable without DEBUG CFLAG
Missed compilability without DEBUG.
-rw-r--r--daemons/dmeventd/dmeventd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index ba7d01c83..56c504abe 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -112,8 +112,6 @@ static int _restart = 0;
static char **_initial_registrations = 0;
/* FIXME Make configurable at runtime */
-#ifdef DEBUG
-# define DEBUGLOG log_debug
__attribute__((format(printf, 4, 5)))
static void _dmeventd_log(int level, const char *file, int line,
const char *format, ...)
@@ -124,6 +122,8 @@ static void _dmeventd_log(int level, const char *file, int line,
va_end(ap);
}
+#ifdef DEBUG
+# define DEBUGLOG log_debug
static const char *decode_cmd(uint32_t cmd)
{
switch (cmd) {
@@ -1535,8 +1535,9 @@ static void _process_request(struct dm_event_fifos *fifos)
{
int die;
struct dm_event_daemon_message msg = { 0 };
+#ifdef DEBUG
int cmd;
-
+#endif
/*
* Read the request from the client (client_read, client_write
* give true on success and false on failure).
@@ -1544,7 +1545,9 @@ static void _process_request(struct dm_event_fifos *fifos)
if (!_client_read(fifos, &msg))
return;
+#ifdef DEBUG
cmd = msg.cmd;
+#endif
DEBUGLOG(">>> CMD:%s (0x%x) processing...", decode_cmd(cmd), cmd);
die = (msg.cmd == DM_EVENT_CMD_DIE) ? 1 : 0;