diff options
Diffstat (limited to 'tests/misc/printenv.sh')
-rwxr-xr-x | tests/misc/printenv.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/misc/printenv.sh b/tests/misc/printenv.sh index 054b02c2..862b48ba 100755 --- a/tests/misc/printenv.sh +++ b/tests/misc/printenv.sh @@ -1,7 +1,7 @@ #!/bin/sh # Verify behavior of printenv. -# Copyright (C) 2009-2014 Free Software Foundation, Inc. +# Copyright (C) 2009-2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,8 +23,12 @@ print_ver_ printenv # printenv as a builtin, so we must invoke it via "env". # But beware of $_, set by many shells to the last command run. # Also, filter out LD_PRELOAD, which is set when running under valgrind. -env | grep -Ev '^(_|LD_PRELOAD=)' > exp || framework_failure_ -env -- printenv | grep -Ev '^(_|LD_PRELOAD=)' > out || fail=1 +# Note the apparently redundant "env env": this is to ensure to get +# env's output the same way as that of printenv and works around a bug +# on aarch64 at least where libc's execvp reverses the order of the +# output. +env -- env | grep -Ev '^(_|LD_PRELOAD)=' > exp || framework_failure_ +env -- printenv | grep -Ev '^(_|LD_PRELOAD)=' > out || fail=1 compare exp out || fail=1 # POSIX is clear that environ may, but need not be, sorted. |