events: move conditional macro check USE_EVENTS inside gf_events

Change-Id: I88279b11b648e676a4544bbb55c7466fbc55ffa7
BUG: 1361983
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: http://review.gluster.org/15054
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Kotresh HR <khiremat@redhat.com>
Reviewed-by: Aravinda VK <avishwan@redhat.com>
This commit is contained in:
Atin Mukherjee 2016-08-01 11:56:27 +05:30 committed by Aravinda VK
parent 4429e84223
commit 8e797e6f4b
3 changed files with 3 additions and 13 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}