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-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
# 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