summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBharata B Rao <bharata@linux.vnet.ibm.com>2013-12-11 12:03:59 +0530
committerVijay Bellur <vbellur@redhat.com>2013-12-11 00:41:57 -0800
commite29080425a762232a90229c380c1ac52593dd0cc (patch)
treeb39d7daafbe7d09075509182c3cc77b57eb35cb6
parentb58810f5df92873ddd658efaae1caddddce96ae2 (diff)
libglusterfs: Explicitly open /dev/stderr logfile
From: Bharata B Rao <bharata@linux.vnet.ibm.com> Currently if stderr is specified as logfile, /dev/stderr isn't opened but stderr is directly used. However libgfapi closes the logfile (and hence stderr) from glfs_fini() which results in stderr becoming unavailable for the application that links to libgfapi. Prevent this unexpected behaviour for the application by explicitly opening /dev/stderr like it is done for any other logfile. Change-Id: I76b754598a2acf40b91ff0461726c5918e278c84 BUG: 1038924 Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-on: http://review.gluster.org/6477 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r--libglusterfs/src/logging.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index 5deb90cda..e3a4a9fde 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -373,9 +373,7 @@ gf_log_init (void *data, const char *file, const char *ident)
}
if (strcmp (file, "-") == 0) {
- ctx->log.gf_log_logfile = stderr;
- ctx->log.logfile = stderr;
- return 0;
+ file = "/dev/stderr";
}
ctx->log.filename = gf_strdup (file);