From owner-svn-src-all@FreeBSD.ORG Thu Jan 8 06:38:07 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4241B106567A; Thu, 8 Jan 2009 06:38:07 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30A628FC14; Thu, 8 Jan 2009 06:38:07 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n086c7vq011110; Thu, 8 Jan 2009 06:38:07 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n086c7pq011109; Thu, 8 Jan 2009 06:38:07 GMT (envelope-from das@svn.freebsd.org) Message-Id: <200901080638.n086c7pq011109@svn.freebsd.org> From: David Schultz Date: Thu, 8 Jan 2009 06:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186887 - head/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2009 06:38:08 -0000 Author: das Date: Thu Jan 8 06:38:06 2009 New Revision: 186887 URL: http://svn.freebsd.org/changeset/base/186887 Log: Set the error indicator on an attempt to write to a read-only stream. PR: 127335 MFC after: 2 weeks Modified: head/lib/libc/stdio/wsetup.c Modified: head/lib/libc/stdio/wsetup.c ============================================================================== --- head/lib/libc/stdio/wsetup.c Thu Jan 8 06:12:03 2009 (r186886) +++ head/lib/libc/stdio/wsetup.c Thu Jan 8 06:38:06 2009 (r186887) @@ -60,6 +60,7 @@ __swsetup(fp) if ((fp->_flags & __SWR) == 0) { if ((fp->_flags & __SRW) == 0) { errno = EBADF; + fp->_flags |= __SERR; return (EOF); } if (fp->_flags & __SRD) {