commit:     0dd8364c03c6f8737150ee4f146ddeeec57efee9
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Thu May 16 05:11:16 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 16 05:11:16 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=0dd8364c

Have esyslog() check that EINFO_LOG is true instead of non-empty

It makes no sense for EINFO_LOG to be exceptional.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 functions.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/functions.sh b/functions.sh
index 050a1d8..bd97f7e 100644
--- a/functions.sh
+++ b/functions.sh
@@ -122,8 +122,7 @@ eoutdent()
 }
 
 #
-# Invokes logger(1) to log the given message, provided that EINFO_LOG is set as
-# a non-empty value.
+# Invokes logger(1) to log the given message, provided that EINFO_LOG is true.
 #
 esyslog()
 {
@@ -132,7 +131,7 @@ esyslog()
        if [ "$#" -lt 2 ]; then
                ewarn "Too few arguments for esyslog (got $#, expected at least 
2)"
                return 1
-       elif [ -n "${EINFO_LOG}" ] && hash logger 2>/dev/null; then
+       elif yesno "${EINFO_LOG}" && hash logger 2>/dev/null; then
                pri=$1
                tag=$2
                shift 2

Reply via email to