summaryrefslogtreecommitdiff
path: root/tests/misc
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2013-05-27 17:01:14 -0700
committerJim Meyering <meyering@fb.com>2013-06-01 20:44:47 -0700
commitaeaeb87c134ce748527ba99e749b7369fcba2438 (patch)
tree0faadcbe2af7e68833f160cb5b484b5c8516ba1f /tests/misc
parent5a7f03c210ece1058bdf172c6a47bfacc15bd73a (diff)
downloadcoreutils-aeaeb87c134ce748527ba99e749b7369fcba2438.tar.xz
tests: head-c: avoid spurious failure with a 32-bit size_t
* tests/misc/head-c.sh: Don't try to elide 1 exabytes, since on 32-bit systems, that number is not representable as a size_t. This command would fail on 32-bit systems, where SIZE_MAX < 1E: head --bytes=-E < /dev/null Instead of "E", use $SSIZE_MAX. For discussion, see http://bugs.gnu.org/13530
Diffstat (limited to 'tests/misc')
-rwxr-xr-xtests/misc/head-c.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/misc/head-c.sh b/tests/misc/head-c.sh
index 37a86cea8..a5b6c6abe 100755
--- a/tests/misc/head-c.sh
+++ b/tests/misc/head-c.sh
@@ -19,6 +19,7 @@
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ head
require_ulimit_v_
+getlimits_
# exercise the fix of 2001-08-18, based on test case from Ian Bruce
echo abc > in || framework_failure_
@@ -31,6 +32,6 @@ esac
# Only allocate memory as needed.
# Coreutils <= 8.21 would allocate memory up front
# based on the value passed to -c
-(ulimit -v 20000; head --bytes=-E < /dev/null) || fail=1
+(ulimit -v 20000; head --bytes=-$SSIZE_MAX < /dev/null) || fail=1
Exit $fail