diff options
author | Pádraig Brady <P@draigBrady.com> | 2016-11-22 01:23:22 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-11-22 20:04:25 +0000 |
commit | 055b08ff7853c7c9ab791643047b1b163a227013 (patch) | |
tree | 15d7a014a486c9c0189cef9511c7e7c7b0470620 /tests/misc/csplit-io-err.sh | |
parent | b572a286d5d24cdb1669baa3f867317bdb534b1a (diff) | |
download | coreutils-055b08ff7853c7c9ab791643047b1b163a227013.tar.xz |
tests: fix false fails due to passing env vars to returns_
On BSD /bin/sh it was seen that unexported env vars passed to
returns_() would not be propagated to the wrapped command.
* cfg.mk (sc_prohibit_env_returns): Add a syntax check to disallow.
* tests/misc/csplit-io-err.sh: Rearrange to export vars in a subshell.
* tests/rm/rm-readdir-fail.sh: Likewise.
* tests/misc/nohup.sh: Export and unset vars around returns_.
* tests/misc/printenv.sh: Likewise.
Reported by Assaf Gordon
Diffstat (limited to 'tests/misc/csplit-io-err.sh')
-rwxr-xr-x | tests/misc/csplit-io-err.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/misc/csplit-io-err.sh b/tests/misc/csplit-io-err.sh index 982df161f..900e38bee 100755 --- a/tests/misc/csplit-io-err.sh +++ b/tests/misc/csplit-io-err.sh @@ -66,9 +66,9 @@ gcc_shared_ k.c k.so \ # Split the input, and force fwrite() failure - # the 'csplit' command should fail with exit code 1 # (checked with 'returns_ 1 ... || fail=1') -seq 10 \ - | LD_PRELOAD=$LD_PRELOAD:./k.so returns_ 1 csplit - 1 4 2>out \ - || fail=1 +seq 10 | +(export LD_PRELOAD=$LD_PRELOAD:./k.so + returns_ 1 csplit - 1 4 2>out) || fail=1 test -e preloaded || skip_ 'LD_PRELOAD interception failed' |