]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 25 Aug 2003 21:45:12 +0000 (21:45 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 25 Aug 2003 21:45:12 +0000 (21:45 +0000)
2003-08-25  Ulrich Drepper  <drepper@redhat.com>

* libio/libio.h (_IO_fwide): In the mode==0 optimization, don't
use _mode if _IO_fwide_maybe_incompatible.
* libio/iofwide.c (_IO_fwide): Move the test for mode == 0 after
the compatibility test.

ChangeLog
libio/iofwide.c
libio/libio.h

index 784e1cdc7dd0cb506d4a206c4ef7a5a8acc16625..a7ed602e593e9e77d0b3dd8736680de1e20c3504 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-08-25  Ulrich Drepper  <drepper@redhat.com>
+
+       * libio/libio.h (_IO_fwide): In the mode==0 optimization, don't
+       use _mode if _IO_fwide_maybe_incompatible.
+       * libio/iofwide.c (_IO_fwide): Move the test for mode == 0 after
+       the compatibility test.
+
 2003-08-25  Jakub Jelinek  <jakub@redhat.com>
 
        * elf/cache.c (save_cache): Don't write beyond end of file_entries
index 225237ef6660ec30e39ca12049ff28e97db1c9d2..03124219ad222986e585986119387f928a6cc62c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -100,20 +100,18 @@ _IO_fwide (fp, mode)
   /* Normalize the value.  */
   mode = mode < 0 ? -1 : (mode == 0 ? 0 : 1);
 
-  if (mode == 0)
-    /* The caller simply wants to know about the current orientation.  */
-    return fp->_mode;
-
 #if defined SHARED && defined _LIBC \
     && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)
   if (__builtin_expect (&_IO_stdin_used == NULL, 0)
-      && (fp == _IO_stdin ||  fp == _IO_stdout || fp == _IO_stderr))
+      && (fp == _IO_stdin || fp == _IO_stdout || fp == _IO_stderr))
     /* This is for a stream in the glibc 2.0 format.  */
     return -1;
 #endif
 
-  if (fp->_mode != 0)
-    /* The orientation already has been determined.  */
+  /* The orientation already has been determined.  */
+  if (fp->_mode != 0
+      /* Or the caller simply wants to know about the current orientation.  */
+      || mode == 0)
     return fp->_mode;
 
   /* Set the orientation appropriately.  */
index 3c6bef9b3773a03167d759ce15ac5d0364d5c637..11274aebb4aa3fe30c698b4d8db968a679410f3f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1995, 1997-2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1995, 1997-2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Per Bothner <bothner@cygnus.com>.
 
@@ -502,7 +502,7 @@ weak_extern (_IO_stdin_used);
         __result = (__fp)->_mode;                                            \
        }                                                                     \
      else if (__builtin_constant_p (__mode) && (__mode) == 0)                \
-       __result = (__fp)->_mode;                                             \
+       __result = _IO_fwide_maybe_incompatible ? -1 : (__fp)->_mode;         \
      else                                                                    \
        __result = _IO_fwide (__fp, __result);                                \
      __result; })