From dd5455ac5f76474d4fca8ab042f5d1a4d7e63950 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Mon, 3 May 2021 16:36:39 +0100 Subject: [PATCH] tests/io.sh: fix spurious failure on Gentoo i386 (re: c4f980eb) --- src/cmd/ksh93/tests/io.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/ksh93/tests/io.sh b/src/cmd/ksh93/tests/io.sh index 77d1171ab..275214591 100755 --- a/src/cmd/ksh93/tests/io.sh +++ b/src/cmd/ksh93/tests/io.sh @@ -824,9 +824,9 @@ got=$(umask 777; set +x; { cat <(echo ok); } 2>&1) # ====== # https://github.com/att/ast/issues/1336 # Use the /proc pseudo filesystem on Linux as a convenient way to force a write I/O error. -if [[ $(uname) == Linux ]] +if [[ -e /proc/self/mem && $(uname) == Linux ]] then - actual=$($SHELL -c 'echo > /proc/self/uid_map; echo okay' 2>&1) + actual=$(LC_ALL=C "$SHELL" -c 'echo > /proc/self/mem; echo okay' 2>&1) expect='write.*failed.*okay' [[ "$actual" =~ $expect ]] || err_exit "I/O failure not handled" \ "(expected $(printf %q "$expect"), got $(printf %q "$actual"))"