summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarian Csontos <mcsontos@redhat.com>2015-07-10 15:27:56 +0200
committerMarian Csontos <mcsontos@redhat.com>2015-07-10 16:02:25 +0200
commit05812f8760393fbdf16600daf1292f9de351cbc5 (patch)
tree9be7190ed7602dd1e2fef48498145278cd0220b8
parenta1915f89b3c2c012e99e449a858581f61b84d9c3 (diff)
downloadlvm2-05812f8760393fbdf16600daf1292f9de351cbc5.tar.gz
log: Empty LVM_LOG_FILE_EPOCH handling
When env.variable is set to empty getenv returns pointer to empty string. In tests it is expected this will produce undecorated debug.log instead of debug.log__*
-rw-r--r--lib/log/log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/log/log.c b/lib/log/log.c
index a439d1da3..4406ef0bd 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -74,7 +74,7 @@ void init_log_file(const char *log_file, int append)
int i = 0;
_log_file_path[0] = '\0';
- if ((env = getenv("LVM_LOG_FILE_EPOCH"))) {
+ if ((env = getenv("LVM_LOG_FILE_EPOCH")) && env[0]) {
while (isalpha(env[i]) && i < 32) /* Up to 32 alphas */
i++;
if (env[i]) {