]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(_IO_new_fclose): Detect new streams and handle them appropriately.
authorUlrich Drepper <drepper@redhat.com>
Wed, 28 Jul 1999 04:35:54 +0000 (04:35 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 28 Jul 1999 04:35:54 +0000 (04:35 +0000)
libio/iofclose.c

index 61f7800ed8ba6458532c500e52f8488dff325f3f..04503e78174b51790158d167f70c6cf52fd002b0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997, 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -36,6 +36,14 @@ _IO_new_fclose (fp)
 
   CHECK_FILE(fp, EOF);
 
+#if defined PIC && DO_VERSIONING
+  /* We desperately try to help programs which are using streams in a
+     strange way and mix old and new functions.  Detect old streams
+     here.  */
+  if (fp->_vtable_offset != 0)
+    return _IO_old_fclose (fp);
+#endif
+
   _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
   _IO_flockfile (fp);
   if (fp->_IO_file_flags & _IO_IS_FILEBUF)