From 7c232609183f41745d5a451fac34b41f59741e99 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 3 Jan 2024 11:58:45 -0500 Subject: tests/bsd/type_w: Check for truncate(1) before using it --- tests/bsd/type_w.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/bsd/type_w.sh b/tests/bsd/type_w.sh index aec9cb1..3aa50d5 100644 --- a/tests/bsd/type_w.sh +++ b/tests/bsd/type_w.sh @@ -5,7 +5,11 @@ command -v newfs &>/dev/null || skip cd "$TEST" # Create a ramdisk -truncate -s1M img +if command -v truncate &>/dev/null; then + truncate -s1M img +else + dd if=/dev/zero of=img bs=1k count=1k +fi md=$(bfs_sudo mdconfig img) || skip defer bfs_sudo mdconfig -du "$md" -- cgit v1.2.3