summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-07-22 16:19:01 +0000
committerpfg <pfg@FreeBSD.org>2014-07-22 16:19:01 +0000
commite0b7f18a537606e35fce0c30a67f5914f676ae52 (patch)
tree25cf1f3764f2bd4f84be7a2fabc4ee763f3f7955 /lib/libc
parent96faf15ff009431d95f6b86f4f203a71df6a0448 (diff)
downloadFreeBSD-src-e0b7f18a537606e35fce0c30a67f5914f676ae52.zip
FreeBSD-src-e0b7f18a537606e35fce0c30a67f5914f676ae52.tar.gz
ftello: return 1 when seeking offset on an append stream.
Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 2 weeks
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/ftell.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/stdio/ftell.c b/lib/libc/stdio/ftell.c
index 2c8800c..1552485 100644
--- a/lib/libc/stdio/ftell.c
+++ b/lib/libc/stdio/ftell.c
@@ -97,6 +97,8 @@ _ftello(FILE *fp, fpos_t *offset)
* Find offset of underlying I/O object, then
* adjust for buffered bytes.
*/
+ if (__sflush(fp)) /* may adjust seek offset on append stream */
+ return (1);
if (fp->_flags & __SOFF)
pos = fp->_offset;
else {
OpenPOWER on IntegriCloud