summaryrefslogtreecommitdiff
path: root/lib/log
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2015-10-13 09:44:33 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2015-10-13 14:40:44 +0200
commit1b1c01a27b359f8e91c3c9e08684c435d8fd51c2 (patch)
treecc1129a3e16efabb08f4fbe068802c1d8ee2e996 /lib/log
parent72d700b064fb64f6bb7e20c23dbb2ce8b6d8feb7 (diff)
downloadlvm2-1b1c01a27b359f8e91c3c9e08684c435d8fd51c2.tar.gz
log: no file for external logging
When external logging is set do not bother creating log file, as it's not going to be used.
Diffstat (limited to 'lib/log')
-rw-r--r--lib/log/log.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/log/log.c b/lib/log/log.c
index bd1136393..7f3136121 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -74,6 +74,10 @@ void init_log_file(const char *log_file, int append)
int i = 0;
_log_file_path[0] = '\0';
+
+ if (_lvm2_log_fn)
+ return; /* No log file, when log function is set */
+
if ((env = getenv("LVM_LOG_FILE_EPOCH"))) {
while (isalpha(env[i]) && i < 32) /* Up to 32 alphas */
i++;