diff options
author | Jim Meyering <jim@meyering.net> | 2006-10-26 15:16:41 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2006-10-26 15:16:41 +0200 |
commit | 0766fb8b54c46d0f17d99d154c0420b73b8cea4b (patch) | |
tree | b976500194d17c5b0162697c38c487f942abe085 /src | |
parent | b40b5b6917f62f59eff8f8bd913bd79e4cebe8f2 (diff) | |
download | coreutils-0766fb8b54c46d0f17d99d154c0420b73b8cea4b.tar.xz |
* src/system.h (ftello): Add a compile-time check for the highly
unlikely condition of off_t narrower than long int, rather than
handling it at run time. Based on a patch from Paul Eggert.
Diffstat (limited to 'src')
-rw-r--r-- | src/system.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/system.h b/src/system.h index efe929098..edb3edecd 100644 --- a/src/system.h +++ b/src/system.h @@ -524,15 +524,8 @@ enum # if ! defined ftello static inline off_t ftello (FILE *stream) { - off_t off = ftell (stream); - if (off < 0) - return off; - if (off != (long int) off) - { - errno = EOVERFLOW; - return -1; - } - return off; + verify (sizeof (long int) <= sizeof (off_t)); + return ftell (stream); } # endif #endif |