From 52f4953ac4a377f9f7fc870d2a81f30c3e5d3c7f Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Tue, 5 Mar 2013 22:41:54 +0000 Subject: [PATCH] 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 --- common.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.config b/common.config index c10163a8..a0b017d7 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 -- 2.39.5