1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

tests/io.sh: fix spurious failure on Gentoo i386 (re: c4f980eb)

This commit is contained in:
Martijn Dekker 2021-05-03 16:36:39 +01:00
parent d5b94a3ff8
commit dd5455ac5f

View file

@ -824,9 +824,9 @@ got=$(umask 777; set +x; { cat <(echo ok); } 2>&1)
# ====== # ======
# https://github.com/att/ast/issues/1336 # 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. # 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 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' expect='write.*failed.*okay'
[[ "$actual" =~ $expect ]] || err_exit "I/O failure not handled" \ [[ "$actual" =~ $expect ]] || err_exit "I/O failure not handled" \
"(expected $(printf %q "$expect"), got $(printf %q "$actual"))" "(expected $(printf %q "$expect"), got $(printf %q "$actual"))"