summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/logging.h
diff options
context:
space:
mode:
authorPoornima G <pgurusid@redhat.com>2013-12-23 05:11:15 +0000
committerVijay Bellur <vbellur@redhat.com>2014-01-20 20:22:47 -0800
commitca7586841e507305ebb951d604c077cf8de84920 (patch)
tree4fa9a2eef8e2e76a0a2283503d17eec6cb417e0b /libglusterfs/src/logging.h
parent16218e529a7b38434d3618b551de1496456ee580 (diff)
gfapi: Closed the logfile fd and initialize to NULL in glfs_fini
Backport of http://review.gluster.org/6552 Currently if logfile is closed and other threads call gf_log after glfs_fini() is executed, it may lead to memory corruption. Adding gf_log_fini() which closes the logfile and initializes the logfile to NULL, thus any further logging happens to stderr. Also added gf_log_globals_fini() which should be filled in the future to release all the logging resources. BUG: 1030228 Change-Id: I90f7fb744b05bc6bd14c61fe143c0814896991e2 Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/6552 Reviewed-on: http://review.gluster.org/6731 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/logging.h')
-rw-r--r--libglusterfs/src/logging.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libglusterfs/src/logging.h b/libglusterfs/src/logging.h
index cc806a76712..e2b7e664d0f 100644
--- a/libglusterfs/src/logging.h
+++ b/libglusterfs/src/logging.h
@@ -153,6 +153,8 @@ int gf_cmd_log_init (const char *filename);
void set_sys_log_level (gf_loglevel_t level);
+int gf_log_fini(void *data);
+
#define GF_DEBUG(xl, format, args...) \
gf_log ((xl)->name, GF_LOG_DEBUG, format, ##args)
#define GF_INFO(xl, format, args...) \