summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli-cmd-peer.c4
-rw-r--r--cli/src/cli-cmd-volume.c8
-rw-r--r--libglusterfs/src/events.c4
3 files changed, 3 insertions, 13 deletions
diff --git a/cli/src/cli-cmd-peer.c b/cli/src/cli-cmd-peer.c
index 36c328a7c12..fc720756dc8 100644
--- a/cli/src/cli-cmd-peer.c
+++ b/cli/src/cli-cmd-peer.c
@@ -90,11 +90,9 @@ out:
CLI_STACK_DESTROY (frame);
-#if (USE_EVENTS)
if (ret == 0) {
gf_event (EVENT_PEER_ATTACH, "host=%s", (char *)words[2]);
}
-#endif
return ret;
}
@@ -166,11 +164,9 @@ out:
CLI_STACK_DESTROY (frame);
-#if (USE_EVENTS)
if (ret == 0) {
gf_event (EVENT_PEER_DETACH, "host=%s", (char *)words[2]);
}
-#endif
return ret;
}
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index af815da51ef..77635b76530 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -243,11 +243,9 @@ out:
}
CLI_STACK_DESTROY (frame);
-#if (USE_EVENTS)
if (ret == 0) {
gf_event (EVENT_VOLUME_CREATE, "name=%s", (char *)words[2]);
}
-#endif
return ret;
}
@@ -322,11 +320,9 @@ out:
CLI_STACK_DESTROY (frame);
-#if (USE_EVENTS)
if (ret == 0) {
gf_event (EVENT_VOLUME_DELETE, "name=%s", (char *)words[2]);
}
-#endif
return ret;
}
@@ -402,11 +398,9 @@ out:
CLI_STACK_DESTROY (frame);
-#if (USE_EVENTS)
if (ret == 0) {
gf_event (EVENT_VOLUME_START, "name=%s", (char *)words[2]);
}
-#endif
return ret;
}
@@ -540,11 +534,9 @@ out:
CLI_STACK_DESTROY (frame);
-#if (USE_EVENTS)
if (ret == 0) {
gf_event (EVENT_VOLUME_STOP, "name=%s", (char *)words[2]);
}
-#endif
return ret;
}
diff --git a/libglusterfs/src/events.c b/libglusterfs/src/events.c
index 9d781874a8a..2df8c29026c 100644
--- a/libglusterfs/src/events.c
+++ b/libglusterfs/src/events.c
@@ -23,12 +23,13 @@
int
gf_event (int event, char *fmt, ...)
{
+ int ret = 0;
+#if (USE_EVENTS)
int sock = -1;
char eventstr[EVENTS_MSG_MAX] = "";
struct sockaddr_un server;
va_list arguments;
char *msg = NULL;
- int ret = 0;
size_t eventstr_size = 0;
if (event < 0 || event >= EVENT_LAST) {
@@ -79,5 +80,6 @@ gf_event (int event, char *fmt, ...)
out:
sys_close(sock);
GF_FREE(msg);
+#endif
return ret;
}