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

Pedro F. Giffuni pfg at FreeBSD.org
Wed Mar 30 13:26:36 UTC 2016


Author: pfg
Date: Wed Mar 30 13:26:35 2016
New Revision: 297417
URL: https://svnweb.freebsd.org/changeset/base/297417

Log:
  freopen(3): prevent uninitialized errno.
  
  Revert completley r297408 (and r297407): this ends up touching errno,
  which we are not allowed to do.
  
  Pointed out by:	ache, bde

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

Modified: head/lib/libc/stdio/freopen.c
==============================================================================
--- head/lib/libc/stdio/freopen.c	Wed Mar 30 10:05:52 2016	(r297416)
+++ head/lib/libc/stdio/freopen.c	Wed Mar 30 13:26:35 2016	(r297417)
@@ -78,7 +78,6 @@ freopen(const char * __restrict file, co
 	 * re-open the same file with a different mode. We allow this only
 	 * if the modes are compatible.
 	 */
-	sverrno = 0;
 	if (file == NULL) {
 		/* See comment below regarding freopen() of closed files. */
 		if (fp->_flags == 0) {


More information about the svn-src-head mailing list