This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix _IO_default_finish


Hi!

_IO_un_link calls flockfile/funlockfile, so I guess we shouldn't
destroy the lock before that.

2007-04-13  Jakub Jelinek  <jakub@redhat.com>

	* 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]