From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24244 invoked by alias); 13 Apr 2007 17:09:05 -0000 Received: (qmail 24228 invoked by uid 22791); 13 Apr 2007 17:09:04 -0000 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 13 Apr 2007 18:09:00 +0100 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id l3DHFG0R017673; Fri, 13 Apr 2007 19:15:16 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id l3DHFGwu017672; Fri, 13 Apr 2007 19:15:16 +0200 Date: Fri, 13 Apr 2007 17:09:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] Fix _IO_default_finish Message-ID: <20070413171516.GI1826@sunsite.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2007-04/txt/msg00006.txt.bz2 Hi! _IO_un_link calls flockfile/funlockfile, so I guess we shouldn't destroy the lock before that. 2007-04-13 Jakub Jelinek * libio/genops.c (_IO_default_finish): Call _IO_lock_fini after _IO_un_link, not before it. --- libc/genops.c.jj 2007-01-17 11:18:43.000000000 +0100 +++ libc/genops.c 2007-04-13 19:04:23.000000000 +0200 @@ -1,4 +1,4 @@ -/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006 +/* Copyright (C) 1993,1995,1997-2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -696,12 +696,12 @@ _IO_default_finish (fp, dummy) fp->_IO_save_base = NULL; } + INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); + #ifdef _IO_MTSAFE_IO if (fp->_lock != NULL) _IO_lock_fini (*fp->_lock); #endif - - INTUSE(_IO_un_link) ((struct _IO_FILE_plus *) fp); } INTDEF(_IO_default_finish) Jakub