about summary refs log tree commit diff
path: root/libio/iofflush.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofflush.c')
-rw-r--r--libio/iofflush.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libio/iofflush.c b/libio/iofflush.c
index 6fe2d5262d..cbc5b1f6d7 100644
--- a/libio/iofflush.c
+++ b/libio/iofflush.c
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 1993, 1995 Free Software Foundation
+Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
 
 This file is part of the GNU IO Library.  This library is free
 software; you can redistribute it and/or modify it under the
@@ -33,10 +33,11 @@ _IO_fflush (fp)
   else
     {
       int result;
-      _IO_flockfile (fp);
       CHECK_FILE (fp, EOF);
+      __libc_cleanup_region_start (&_IO_funlockfile, fp);
+      _IO_flockfile (fp);
       result = _IO_SYNC (fp) ? EOF : 0;
-      _IO_funlockfile (fp);
+      __libc_cleanup_region_end (1);
       return result;
     }
 }