]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
* src/system.h (ftello): Add a compile-time check for the highly
authorJim Meyering <jim@meyering.net>
Thu, 26 Oct 2006 13:16:41 +0000 (15:16 +0200)
committerJim Meyering <jim@meyering.net>
Thu, 26 Oct 2006 13:16:41 +0000 (15:16 +0200)
unlikely condition of off_t narrower than long int, rather than
handling it at run time.  Based on a patch from Paul Eggert.

ChangeLog
src/system.h

index a09b53845b8529af50b586a655f2a02524e00934..18970d0df964531f5c1156de7c6f9b0aaff0caf1 100644 (file)
--- 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
index efe92909849b22bb587613b5c8512bda9b6e45d9..edb3edecd9d3a545f81b023fee672d759cb1bcc8 100644 (file)
@@ -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