diff options
| author | Pranith Kumar K <pkarampu@redhat.com> | 2016-10-18 15:16:17 +0530 | 
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2016-11-23 21:44:51 -0800 | 
| commit | 66f5c8a6f06c389cfb8b845254d3033f2b22801a (patch) | |
| tree | 4b04ef958d765aa0c0692ecd30ff49c32740fbf7 /libglusterfs | |
| parent | 73b0debb4f489f671e3fcd33b2c70ca9f3a2b70a (diff) | |
events: Add FMT_WARN for gf_event
Raghavendra G found that posix is trying to print %s
but passing an int when HEALTH_CHECK fails in posix.
These are the kind of bugs that should be caught
at compilation itself.
Also fixed the problematic gf_event() callers.
 >BUG: 1386097
 >Change-Id: Id7bd6d9a9690237cec3ca1aefa2aac085e8a1270
 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
 >Reviewed-on: http://review.gluster.org/15671
 >Smoke: Gluster Build System <jenkins@build.gluster.org>
 >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
 >Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
 >CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
BUG: 1396778
Change-Id: Idf8e1f427578d02dccd2a8165884a5cf086eb07e
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/15884
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/events.c | 2 | ||||
| -rw-r--r-- | libglusterfs/src/events.h | 10 | 
2 files changed, 9 insertions, 3 deletions
diff --git a/libglusterfs/src/events.c b/libglusterfs/src/events.c index b7b513eb39a..6b3a73d8ae4 100644 --- a/libglusterfs/src/events.c +++ b/libglusterfs/src/events.c @@ -32,7 +32,7 @@  int -gf_event (eventtypes_t event, char *fmt, ...) +_gf_event (eventtypes_t event, char *fmt, ...)  {          int                ret                   = 0;          int                sock                  = -1; diff --git a/libglusterfs/src/events.h b/libglusterfs/src/events.h index 6b280a0066f..e059bc9c4d1 100644 --- a/libglusterfs/src/events.h +++ b/libglusterfs/src/events.h @@ -15,13 +15,19 @@  #ifdef USE_EVENTS  int -gf_event (eventtypes_t event, char *fmt, ...); +_gf_event (eventtypes_t event, char *fmt, ...);  #else  static inline int -gf_event (eventtypes_t event, char *fmt, ...) +_gf_event (eventtypes_t event, char *fmt, ...)  {          return 0;  }  #endif /* USE_EVENTS */ +#define gf_event(event, fmt...)                         \ +        do {                                            \ +                FMT_WARN(fmt);                          \ +                _gf_event (event, ##fmt);               \ +        } while (0) +  #endif /* __EVENTS_H__ */  | 
