From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10799 invoked by alias); 10 Apr 2003 19:52:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 10771 invoked from network); 10 Apr 2003 19:52:11 -0000 Received: from unknown (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sources.redhat.com with SMTP; 10 Apr 2003 19:52:11 -0000 Received: from hiauly1.hia.nrc.ca (localhost [127.0.0.1]) by hiauly1.hia.nrc.ca (8.12.9/8.12.9) with ESMTP id h3AJq9Bh027202; Thu, 10 Apr 2003 15:52:10 -0400 (EDT) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.9/8.12.9/Submit) id h3AJq9YR027201; Thu, 10 Apr 2003 15:52:09 -0400 (EDT) Message-Id: <200304101952.h3AJq9YR027201@hiauly1.hia.nrc.ca> Subject: Re: Failure of test07 in 27_io/filebuf_members.cc under HP-UX (PR 9964) To: dave@hiauly1.hia.nrc.ca (John David Anglin) Date: Thu, 10 Apr 2003 19:52:00 -0000 From: "John David Anglin" Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org In-Reply-To: from "John David Anglin" at Apr 10, 2003 03:06:24 pm MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00684.txt.bz2 > I have examined the failure of 27_io/filebuf_members.cc on > hppa2.0w-hp-hpux11.11. The test fails because the following code > from config/io/basic_file_stdio.cc doesn't close the file after a > character is written to a broken pipe: The enclosed patch against the 3.3 branch fixes the failure of 27_io/filebuf_members.cc on hppa2.0w-hp-hpux11.11. Ok for 3.3 and main? Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) 2003-04-10 John David Anglin * basic_file_stdio.cc (__basic_file::close): Don't flush stream twice. Always set _M_cfile to 0 when stream was open. Index: config/io/basic_file_stdio.cc =================================================================== RCS file: /cvs/gcc/gcc/libstdc++-v3/config/io/basic_file_stdio.cc,v retrieving revision 1.6.2.2 diff -u -3 -p -r1.6.2.2 basic_file_stdio.cc --- config/io/basic_file_stdio.cc 5 Feb 2003 19:20:07 -0000 1.6.2.2 +++ config/io/basic_file_stdio.cc 10 Apr 2003 19:39:25 -0000 @@ -181,12 +181,12 @@ namespace std __basic_file* __retval = static_cast<__basic_file*>(NULL); if (this->is_open()) { - fflush(_M_cfile); - if ((_M_cfile_created && fclose(_M_cfile) == 0) || !_M_cfile_created) - { - _M_cfile = 0; - __retval = this; - } + if (_M_cfile_created) + fclose(_M_cfile); + else + fflush(_M_cfile); + _M_cfile = 0; + __retval = this; } return __retval; }