summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-10-26 15:16:41 +0200
committerJim Meyering <jim@meyering.net>2006-10-26 15:16:41 +0200
commit0766fb8b54c46d0f17d99d154c0420b73b8cea4b (patch)
treeb976500194d17c5b0162697c38c487f942abe085 /src
parentb40b5b6917f62f59eff8f8bd913bd79e4cebe8f2 (diff)
downloadcoreutils-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.h11
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