diff options
author | Csaba Henk <csaba@gluster.com> | 2011-10-05 11:47:14 +0200 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-11-20 07:36:02 -0800 |
commit | e1de01c3fdde2497cc4a24491b75579624467456 (patch) | |
tree | f258dfb6e104a28a9112f81ae245c2b487c5b432 /libglusterfs/src/logging.c | |
parent | 76d5e5d5b51eb2ffe5a0608bf8869650bb76585f (diff) |
log to stderr if "-" is given as log-file
This works around broken /dev/stderr on some systems.
Change-Id: I017b03082ff630c4a713ae74990e88b3fa20d0e1
BUG: 3686
Reviewed-on: http://review.gluster.com/560
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src/logging.c')
-rw-r--r-- | libglusterfs/src/logging.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index 5b9c1fc4f74..5485260bc10 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -136,6 +136,12 @@ gf_log_init (const char *file) return -1; } + if (strcmp (file, "-") == 0) { + gf_log_logfile = stderr; + + return 0; + } + filename = gf_strdup (file); if (!filename) { fprintf (stderr, "ERROR: updating log-filename failed: %s\n", |