From: Eric Sandeen Date: Tue, 5 Mar 2013 22:41:54 +0000 (+0000) Subject: xfstests: Fix hang when mkfs.btrfs isn't present X-Git-Tag: v2022.05.01~3523 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=52f4953ac4a377f9f7fc870d2a81f30c3e5d3c7f;p=users%2Fhch%2Fxfstests-dev.git xfstests: Fix hang when mkfs.btrfs isn't present My earlier patch (xfstests: handle new mkfs.btrfs -f option cleanly) had a flaw in that if set_prog_path mkfs.btrfs returns nothing, the grep will hang. Test for that case to avoid it, and just return the empty string in that case. Reported-by: Rich Johnston Signed-off-by: Eric Sandeen Reviewed-by: Rich Johnston Signed-off-by: Rich Johnston --- diff --git a/common.config b/common.config index c10163a8d..a0b017d7e 100644 --- a/common.config +++ b/common.config @@ -108,7 +108,7 @@ set_prog_path() set_btrfs_mkfs_prog_path_with_opts() { p=`set_prog_path mkfs.btrfs` - if grep -q 'force overwrite' $p; then + if [ "$p" != "" ] && grep -q 'force overwrite' $p; then echo "$p -f" else echo $p