summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-10-03 08:38:41 +0000
committerUlrich Drepper <drepper@redhat.com>2002-10-03 08:38:41 +0000
commit393db3d2f833a0425813361cd8353dc6e2aa9c48 (patch)
treea82779440bdaf1dbe42b97ad5ff5608ce496c324
parent4011dc709c4350165a32813d8dd2112d7d49858b (diff)
downloadglibc-393db3d2f833a0425813361cd8353dc6e2aa9c48.tar.gz
glibc-393db3d2f833a0425813361cd8353dc6e2aa9c48.tar.xz
glibc-393db3d2f833a0425813361cd8353dc6e2aa9c48.zip
Update.
2002-10-03  Ulrich Drepper  <drepper@redhat.com>

	* libio/freopen.c: Don't re-set _wide_data element if the stream
	is of old style which didn't have the element.
	* libio/freopen64.c: Likewise.
-rw-r--r--ChangeLog6
-rw-r--r--libio/freopen.c3
-rw-r--r--libio/freopen64.c3
3 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b9febc18a0..bfbebf5c77 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-03  Ulrich Drepper  <drepper@redhat.com>
+
+	* libio/freopen.c: Don't re-set _wide_data element if the stream
+	is of old style which didn't have the element.
+	* libio/freopen64.c: Likewise.
+
 2002-10-02  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/x86_64/Dist: Add bits/utmpx.h.
diff --git a/libio/freopen.c b/libio/freopen.c
index 01816a179a..244a90d84e 100644
--- a/libio/freopen.c
+++ b/libio/freopen.c
@@ -68,7 +68,8 @@ freopen (filename, mode, fp)
     {
       INTUSE(_IO_file_close_it) (fp);
       _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &INTUSE(_IO_file_jumps);
-      fp->_wide_data->_wide_vtable = &INTUSE(_IO_wfile_jumps);
+      if (fp->_vtable_offset == 0 && fp->_wide_data != NULL)
+	fp->_wide_data->_wide_vtable = &INTUSE(_IO_wfile_jumps);
       result = INTUSE(_IO_file_fopen) (fp, filename, mode, 1);
       if (result != NULL)
 	result = __fopen_maybe_mmap (result);
diff --git a/libio/freopen64.c b/libio/freopen64.c
index 7ab9bd315a..8f69fce2ce 100644
--- a/libio/freopen64.c
+++ b/libio/freopen64.c
@@ -54,7 +54,8 @@ freopen64 (filename, mode, fp)
     }
   INTUSE(_IO_file_close_it) (fp);
   _IO_JUMPS ((struct _IO_FILE_plus *) fp) = &INTUSE(_IO_file_jumps);
-  fp->_wide_data->_wide_vtable = &INTUSE(_IO_wfile_jumps);
+  if (fp->_vtable_offset == 0 && fp->_wide_data != NULL)
+    fp->_wide_data->_wide_vtable = &INTUSE(_IO_wfile_jumps);
   result = INTUSE(_IO_file_fopen) (fp, filename, mode, 0);
   if (result != NULL)
     result = __fopen_maybe_mmap (result);