summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/logging.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index 159a21b1f..5b9c1fc4f 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -607,7 +607,11 @@ gf_cmd_log_init (const char *filename)
" error\n");
return -1;
}
-
+ /* close and reopen cmdlogfile for log rotate*/
+ if (cmdlogfile) {
+ fclose (cmdlogfile);
+ cmdlogfile = NULL;
+ }
cmdlogfile = fopen (cmd_log_filename, "a");
if (!cmdlogfile){
gf_log ("glusterd", GF_LOG_CRITICAL,