diff options
author | Amar Tumballi <amar@gluster.com> | 2009-12-03 16:10:17 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-12-03 13:54:57 -0800 |
commit | aa53bb583d2d01867a2db1d217001fc897e2b835 (patch) | |
tree | 2c0f41e380bb33e6d766088ac1a7e7240fc8406d /libglusterfs/src/logging.c | |
parent | cec1f78d42f49f35448d81c944afb9afae19c959 (diff) |
fixing some warnings on 64bit machine.
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 408 (warning while building on 64bit machine..)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=408
Diffstat (limited to 'libglusterfs/src/logging.c')
-rw-r--r-- | libglusterfs/src/logging.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index 46b3ac5af..a006184cc 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -429,9 +429,11 @@ _gf_log (const char *domain, const char *file, const char *function, int line, struct tm *tm = NULL; char timestr[256]; - char *str1, *str2, *msg; - size_t len = 0; - int ret = 0; + char *str1 = NULL; + char *str2 = NULL; + char *msg = NULL; + size_t len = 0; + int ret = 0; static char *level_strings[] = {"", /* NONE */ "C", /* CRITICAL */ @@ -516,18 +518,18 @@ log: unlock: pthread_mutex_unlock (&logfile_mutex); - if ((ret != -1) && __central_log_enabled && - ((glusterfs_central_log_flag_get ()) == 0)) { - - glusterfs_central_log_flag_set (); - { - gf_log_central (msg); - } - glusterfs_central_log_flag_unset (); - } + if (msg) { + if ((ret != -1) && __central_log_enabled && + ((glusterfs_central_log_flag_get ()) == 0)) { - if (msg) + glusterfs_central_log_flag_set (); + { + gf_log_central (msg); + } + glusterfs_central_log_flag_unset (); + } FREE (msg); + } if (str1) FREE (str1); |