summaryrefslogtreecommitdiff
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
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.
-rw-r--r--ChangeLog6
-rw-r--r--src/system.h11
2 files changed, 8 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index a09b53845..18970d0df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-26 Jim Meyering <jim@meyering.net>
+
+ * 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.
+
2006-10-25 Paul Eggert <eggert@cs.ucla.edu>
* tests/chmod/c-option: When double-quoting part of a word, prefer
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