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

index 51781366d69e0ffd60b4e8350241c0978b5d6c4b..8ddad32b042ffec388bf5ce5520418e5cfdb9bf2 100644 (file)
@@ -37,6 +37,12 @@ _IO_old_fclose (fp)
 
   CHECK_FILE(fp, EOF);
 
+  /* We desperately try to help programs which are using streams in a
+     strange way and mix old and new functions.  Detect new streams
+     here.  */
+  if (fp->_vtable_offset == 0)
+    return _IO_new_fclose (fp);
+
   _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
   _IO_flockfile (fp);
   if (fp->_IO_file_flags & _IO_IS_FILEBUF)