svn commit: r289931 - head/lib/libc/stdio

Andrey A. Chernov ache at FreeBSD.org
Sun Oct 25 12:09:29 UTC 2015


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.


More information about the svn-src-all mailing list