Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Oct 2015 12:09:28 +0000 (UTC)
From:      "Andrey A. Chernov" <ache@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r289931 - head/lib/libc/stdio
Message-ID:  <201510251209.t9PC9SRg033909@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ache
Date: Sun Oct 25 12:09:28 2015
New Revision: 289931
URL: https://svnweb.freebsd.org/changeset/base/289931

Log:
  According to POSIX, a write operation shall start at the current size of
  the stream (if mode had 'a' as the first character).
  
  MFC after:      1 week

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

Modified: head/lib/libc/stdio/fmemopen.c
==============================================================================
--- head/lib/libc/stdio/fmemopen.c	Sun Oct 25 10:49:05 2015	(r289930)
+++ head/lib/libc/stdio/fmemopen.c	Sun Oct 25 12:09:28 2015	(r289931)
@@ -149,6 +149,9 @@ fmemopen(void * __restrict buf, size_t s
 		return (NULL);
 	}
 
+	if (mode[0] == 'a')
+		f->_flags |= __SAPP;
+
 	/*
 	 * Turn off buffering, so a write past the end of the buffer
 	 * correctly returns a short object count.



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