From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9799 invoked by alias); 9 Sep 2005 16:00:43 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 9772 invoked by uid 48); 9 Sep 2005 16:00:37 -0000 Date: Fri, 09 Sep 2005 16:00:00 -0000 Message-ID: <20050909160037.9770.qmail@sourceware.org> From: "fxcoudert at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050908200747.23784.tkoenig@gcc.gnu.org> References: <20050908200747.23784.tkoenig@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug libfortran/23784] close doesn't reset ioparm on error exit X-Bugzilla-Reason: CC X-SW-Source: 2005-09/txt/msg01143.txt.bz2 List-Id: ------- Additional Comments From fxcoudert at gcc dot gnu dot org 2005-09-09 16:00 ------- It's just that we should call library_end() before returning in st_close: Index: libgfortran/io/close.c =================================================================== RCS file: /cvs/gcc/gcc/libgfortran/io/close.c,v retrieving revision 1.8 diff -p -u -r1.8 close.c --- libgfortran/io/close.c 27 Aug 2005 16:01:54 -0000 1.8 +++ libgfortran/io/close.c 9 Sep 2005 15:59:16 -0000 @@ -64,7 +64,10 @@ st_close (void) "Bad STATUS parameter in CLOSE statement"); if (ioparm.library_return != LIBRARY_OK) + { + library_end (); return; + } u = find_unit (ioparm.unit); if (u != NULL) No time to regtest this, but if someone want to test & commit as obvious, he can gladly take credit for this genial patch :) -- What |Removed |Added ---------------------------------------------------------------------------- CC| |fxcoudert at gcc dot gnu dot | |org Status|UNCONFIRMED |NEW Ever Confirmed| |1 Keywords| |patch Last reconfirmed|0000-00-00 00:00:00 |2005-09-09 16:00:35 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23784