From: Collin Funk Date: Thu, 9 Apr 2026 01:57:54 +0000 (-0700) Subject: tests: avoid a failure on musl X-Git-Tag: v9.11~10 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=1603c75d747ab6c95d24ba31ef92bdf672c0b568;p=thirdparty%2Fcoreutils.git tests: avoid a failure on musl * tests/misc/io-errors.sh: Allow a generic error string on musl since the first line is emitted immediately instead of being buffered as expected. Reported by Bruno Haible. --- diff --git a/tests/misc/io-errors.sh b/tests/misc/io-errors.sh index 8d01aa913e..72bfeb4584 100755 --- a/tests/misc/io-errors.sh +++ b/tests/misc/io-errors.sh @@ -83,6 +83,15 @@ while read writer; do # For e.g. with _IOLBF etc, stdio will discard pending data at each line, # thus only giving a generic error upon ferror() in close_stream(). error_re="$ENOSPC" + + # musl writes the first line immediately when it should be fully buffered. + # As a result, when we print a single line there is no bytes buffered when + # we close the stream and errno is not set. See: + # . + case $host_triplet in + *-musl*) error_re="$error_re|" ;; + esac + printf '%s' "$writer" | grep 'generic' >/dev/null && { error_re="write error|$error_re"; }