From 00b159840added72099f61f45b38133e856d23bf Mon Sep 17 00:00:00 2001 From: Bharata B Rao Date: Mon, 9 Dec 2013 11:15:02 +0530 Subject: libglusterfs: Explicitly open /dev/stderr logfile 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 Reviewed-on: http://review.gluster.org/6452 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/logging.c | 4 +--- 1 file changed, 1 insertion(+), 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); -- cgit