diff options
author | Dan Albert <danalbert@google.com> | 2015-06-01 11:28:31 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-06-01 13:24:36 -0700 |
commit | c5e02eeb353c3cdd357413f563701d5018fc76a5 (patch) | |
tree | b59637eebc2fb12c42ecfec5054ec3e1f4d7d91b /libc | |
parent | 5f3e19dbbeb851fff5cf7f9869d344feca479413 (diff) | |
download | bionic-c5e02eeb353c3cdd357413f563701d5018fc76a5.zip bionic-c5e02eeb353c3cdd357413f563701d5018fc76a5.tar.gz bionic-c5e02eeb353c3cdd357413f563701d5018fc76a5.tar.bz2 |
Cleanup ftruncate negative test.
Addresses post-submit comments from
I54692ab8105dd09db6af7a2c0894a17bdd118aa0.
Bug: http://b/21309901
Change-Id: Ie19ee8cdcc4055a65fe7dfc103156e54eafe8977
(cherry picked from commit 9d476a02e9a14e847669a6683c585028175aa322)
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/ftruncate.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libc/bionic/ftruncate.cpp b/libc/bionic/ftruncate.cpp index c073f2d..9936df0 100644 --- a/libc/bionic/ftruncate.cpp +++ b/libc/bionic/ftruncate.cpp @@ -18,11 +18,14 @@ #include <sys/cdefs.h> #include <unistd.h> -#if !defined(__USE_FILE_OFFSET64) && !defined(__LP64__) +#if !defined(__LP64__) +static_assert(sizeof(off_t) == 4, + "libc can't be built with _FILE_OFFSET_BITS=64."); + // The kernel's implementation of ftruncate uses an unsigned long for the length // parameter, so it will not catch negative values. On the other hand // ftruncate64 does check for this, so just forward the call. int ftruncate(int filedes, off_t length) { return ftruncate64(filedes, length); } -#endif +#endif // !defined(__LP64__) |