summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-01-03 11:58:45 -0500
committerTavian Barnes <tavianator@tavianator.com>2024-01-03 12:13:15 -0500
commit7c232609183f41745d5a451fac34b41f59741e99 (patch)
treeb7a9143ad4aa6a715d2a8d37f5b7c3655217fddb
parentb12670c79356fa9eeca52bafb1bfadf4cd86a1d7 (diff)
downloadbfs-7c232609183f41745d5a451fac34b41f59741e99.tar.xz
tests/bsd/type_w: Check for truncate(1) before using it
-rw-r--r--tests/bsd/type_w.sh6
1 files changed, 5 insertions, 1 deletions
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"