Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Jul 2014 16:19:01 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r268984 - head/lib/libc/stdio
Message-ID:  <201407221619.s6MGJ10G068003@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Tue Jul 22 16:19:01 2014
New Revision: 268984
URL: http://svnweb.freebsd.org/changeset/base/268984

Log:
  ftello: return 1 when seeking offset on an append stream.
  
  Obtained from:	Apple Inc. (Libc 997.90.3)
  Phabric:	D442
  MFC after:	2 weeks

Modified:
  head/lib/libc/stdio/ftell.c

Modified: head/lib/libc/stdio/ftell.c
==============================================================================
--- head/lib/libc/stdio/ftell.c	Tue Jul 22 16:10:56 2014	(r268983)
+++ head/lib/libc/stdio/ftell.c	Tue Jul 22 16:19:01 2014	(r268984)
@@ -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 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407221619.s6MGJ10G068003>