diff options
author | Marian Csontos <mcsontos@redhat.com> | 2015-07-10 15:27:56 +0200 |
---|---|---|
committer | Marian Csontos <mcsontos@redhat.com> | 2015-07-10 15:27:56 +0200 |
commit | 04b224c6f9f3e1d2e83e0663e6e7e5313ada0a99 (patch) | |
tree | dc39ed0630c12affab67e2251082f9ad028489a0 | |
parent | 06041318f5a578c49cac19cb6dbf49e60c56c618 (diff) | |
download | lvm2-dev-mcsontos-fixes.tar.gz |
log: Empty LVM_LOG_FILE_EPOCH handlingdev-mcsontos-fixes
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/log/log.c b/lib/log/log.c index a439d1da3..3a8f4efac 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -82,7 +82,10 @@ void init_log_file(const char *log_file, int append) log_warn("WARNING: Ignoring invalid LVM_LOG_FILE_EPOCH envvar \"%s\".", env); goto no_epoch; } - + if (!i) { + log_debug("Empty LVM_LOG_FILE_EPOCH envvar set."); + goto no_epoch; + } if (!(st = fopen(statfile, "r"))) log_sys_error("fopen", statfile); else if (fscanf(st, "%d %*s %*c %*d %*d %*d %*d " /* tty_nr */ |