aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2014-07-22 16:19:01 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2014-07-22 16:19:01 +0000
commit4a4e32a81de722e6dc702b0f6eec980f2e07ca4a (patch)
tree25cf1f3764f2bd4f84be7a2fabc4ee763f3f7955 /lib
parentc03225695d7db0ba896054aa035fe43c2c6002f6 (diff)
ftello: return 1 when seeking offset on an append stream.
Obtained from: Apple Inc. (Libc 997.90.3) Phabric: D442 MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=268984
Diffstat (limited to 'lib')
-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 2c8800ccfe19..155248527072 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 {