Skip to contentSkip to conversation

fixfiles: fix test for $LOGFILE

PATCH In review James Morris 2 participants 2 messages Aug 12, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fixfiles: fix test for $LOGFILE

Please apply.

---

fixfiles renamed from fixfiles.orig +1 -1
@@ -48,7 +48,7 @@
 # Log to either syslog or a LOGFILE
 #
 logit () {
-if [ -z $LOGFILE ]; then
+if [ ! -z $LOGFILE ]; then
     echo $1 >> $LOGFILE
 fi
 }

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 8 lines · James Morris

Please apply.

---

fixfiles line 54

Quoted 8 lines
fixfiles renamed from fixfiles.orig +1 -1
@@ -48,7 +48,7 @@
 # Log to either syslog or a LOGFILE
 #
 logit () {
-if [ -z $LOGFILE ]; then
+if [ ! -z $LOGFILE ]; then
     echo $1 >> $LOGFILE
 fi
 }

Why not if [ -n $LOGFILE ]; then ?

From man bash:
-z string
True if the length of string is zero.
string
-n string
True if the length of string is non-zero.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.