mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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 <rjohnston@sgi.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Rich Johnston <rjohnston@sgi.com> Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
committed by
Rich Johnston
parent
6f000a96dc
commit
52f4953ac4
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user