Fix locking in _IO_flush_all_lockp
authorAndreas Schwab <schwab@redhat.com>
Mon, 7 Nov 2011 14:07:31 +0000 (15:07 +0100)
committerAndreas Schwab <schwab@redhat.com>
Mon, 7 Nov 2011 14:20:59 +0000 (15:20 +0100)
ChangeLog
libio/genops.c

index b09f5ef..3a71044 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-11-07  Andreas Schwab  <schwab@redhat.com>
 
+       * libio/genops.c (_IO_flush_all_lockp): Only register cleanup
+       handler when locking.
+
        * nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn):
        Fix size of allocated buffer.
 
index 5d21c42..bb40c34 100644 (file)
@@ -826,7 +826,7 @@ _IO_flush_all_lockp (int do_lock)
   int last_stamp;
 
 #ifdef _IO_MTSAFE_IO
-  _IO_cleanup_region_start_noarg (flush_cleanup);
+  __libc_cleanup_region_start (do_lock, flush_cleanup, 0);
   if (do_lock)
     _IO_lock_lock (list_all_lock);
 #endif
@@ -866,7 +866,7 @@ _IO_flush_all_lockp (int do_lock)
 #ifdef _IO_MTSAFE_IO
   if (do_lock)
     _IO_lock_unlock (list_all_lock);
-  _IO_cleanup_region_end (0);
+  __libc_cleanup_region_end (0);
 #endif
 
   return result;