diff options
author | Aravinda VK <avishwan@redhat.com> | 2016-08-18 14:51:44 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2016-08-24 01:23:06 -0700 |
commit | d1aa35c3619847922e092b7dbfb201bceea8fa33 (patch) | |
tree | a2f936c481b9201b63a4bf77f1346946f69cb8a3 /libglusterfs/src/events.h | |
parent | 4aa52061a51b97c4f865b402f977b3b43f5471a7 (diff) |
eventsapi: Fix disable-events issue
Events related sources are not loaded in libglusterfs when
configure is run with --disable-events option. Due to this
every call of gf_event should be guarded with USE_EVENTS macro.
To prevent this, USE_EVENTS macro was included in events.c
itself(Patch #15054)
Instead of disabling building entire directory "events", selectively
disabled the code. So that constants and empty function gf_event is
exposed. Code will not fail even if gf_event is called when events is
disabled.
BUG: 1368042
Change-Id: Ia6abfe9c1e46a7640c4d8ff5ccf0e9c30c87f928
Signed-off-by: Aravinda VK <avishwan@redhat.com>
Reviewed-on: http://review.gluster.org/15198
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs/src/events.h')
-rw-r--r-- | libglusterfs/src/events.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libglusterfs/src/events.h b/libglusterfs/src/events.h new file mode 100644 index 00000000000..6b280a0066f --- /dev/null +++ b/libglusterfs/src/events.h @@ -0,0 +1,27 @@ +/* + Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com> + This file is part of GlusterFS. + + This file is licensed to you under your choice of the GNU Lesser + General Public License, version 3 or any later version (LGPLv3 or + later), or the GNU General Public License, version 2 (GPLv2), in all + cases as published by the Free Software Foundation. +*/ + +#ifndef __EVENTS_H__ +#define __EVENTS_H__ + +#include "eventtypes.h" + +#ifdef USE_EVENTS +int +gf_event (eventtypes_t event, char *fmt, ...); +#else +static inline int +gf_event (eventtypes_t event, char *fmt, ...) +{ + return 0; +} +#endif /* USE_EVENTS */ + +#endif /* __EVENTS_H__ */ |