From: Pádraig Brady
Date: Tue, 14 Jul 2026 11:07:07 +0000 (+0100)
Subject: tests: dd: fix false failure on NetBSD
X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c279e1557a90ce3f40c016de7c1c5e7023df0f8b;p=thirdparty%2Fcoreutils.git
tests: dd: fix false failure on NetBSD
* tests/cat/cat-distinct-err.sh: /proc/self/mem fails with EINVAL
on NetBSD, so extract the error from dd for comparison.
Reported by Bruno Haible.
---
diff --git a/tests/cat/cat-distinct-err.sh b/tests/cat/cat-distinct-err.sh
index cf21be225b..5b15ddc146 100755
--- a/tests/cat/cat-distinct-err.sh
+++ b/tests/cat/cat-distinct-err.sh
@@ -29,10 +29,11 @@ if test -w /dev/full && test -c /dev/full; then
fi
# read error
-if test -e /proc/self/mem &&
- returns_ 1 dd if=/proc/self/mem bs=1 count=1; then
- echo "cat: /proc/self/mem: $EIO" >exp || framework_failure_
- returns_ 1 cat /proc/self/mem 2>err || fail=1
+errf='/proc/self/mem'
+if returns_ 1 dd if=$errf bs=1 count=1 status=none 2>errt; then
+ err_mem=$(sed 's/dd: .*: //'