lkml.org 
[lkml]   [2023]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] tools/bootconfig: fix single & used for logical condition
Date
A single & will create a background process and return true, so the grep
command will run even if the file checked in the first condition does not
exist.

Signed-off-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
---
tools/bootconfig/scripts/ftrace2bconf.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bootconfig/scripts/ftrace2bconf.sh b/tools/bootconfig/scripts/ftrace2bconf.sh
index 6183b36c6846..1603801cf126 100755
--- a/tools/bootconfig/scripts/ftrace2bconf.sh
+++ b/tools/bootconfig/scripts/ftrace2bconf.sh
@@ -93,7 +93,7 @@ referred_vars() {
}

event_is_enabled() { # enable-file
- test -f $1 & grep -q "1" $1
+ test -f $1 && grep -q "1" $1
}

per_event_options() { # event-dir
--
2.35.3
\
 
 \ /
  Last update: 2023-03-26 23:37    [W:0.029 / U:1.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site