summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio64/ftello64.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio64/ftello64.c')
-rw-r--r--newlib/libc/stdio64/ftello64.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/newlib/libc/stdio64/ftello64.c b/newlib/libc/stdio64/ftello64.c
index b596d3234..2fdfb784e 100644
--- a/newlib/libc/stdio64/ftello64.c
+++ b/newlib/libc/stdio64/ftello64.c
@@ -91,6 +91,10 @@ _DEFUN (_ftello64_r, (ptr, fp),
{
_fpos64_t pos;
+ /* Only do 64-bit tell on large file. */
+ if (!(fp->_flags & __SL64))
+ return (_off64_t) _ftello_r (ptr, fp);
+
/* Ensure stdio is set up. */
CHECK_INIT (ptr, fp);
@@ -106,7 +110,7 @@ _DEFUN (_ftello64_r, (ptr, fp),
/* Find offset of underlying I/O object, then
adjust for buffered bytes. */
- fflush(fp); /* may adjust seek offset on append stream */
+ _fflush_r (ptr, fp); /* may adjust seek offset on append stream */
if (fp->_flags & __SOFF)
pos = fp->_offset;
else