]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Avoid dup3 PLT usage.
authorThomas Schwinge <thomas@codesourcery.com>
Sat, 12 May 2012 02:53:04 +0000 (10:53 +0800)
committerThomas Schwinge <thomas@codesourcery.com>
Sat, 12 May 2012 02:53:04 +0000 (10:53 +0800)
Fixes fallout from 5aa3a74a59916b489e9cf7c4dce9eb149e106c6c.

ChangeLog
io/dup3.c
libio/freopen.c
libio/freopen64.c
sysdeps/unix/syscalls.list

index 0c4a814167a7991311fa8d1c0bb0e6f25c86b0cc..8a10d6ab09aef4ccbd0d6bd8bddd3cc8c1ad06d3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-12  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * io/dup3.c (dup3): Rename to __dup3, add weak alias for dup3.
+       * sysdeps/unix/syscalls.list (dup3): Likewise.
+       * libio/freopen.c (freopen): Invoke __dup3 instead of dup3.
+       * libio/freopen64.c (freopen64): Invoke __dup3 instead of dup3.
+
 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf/stackguard-macros.h (STACK_CHK_GUARD) [__x86_64__]: Use
index 90a3d60898c35dcd9eccf8883bff059dba06b768..7e97bf733c83486d10fb69f5a46ede2f5c3e66f1 100644 (file)
--- a/io/dup3.c
+++ b/io/dup3.c
@@ -24,7 +24,7 @@
    open the same file as FD is which setting flags according to
    FLAGS.  Return FD2 or -1.  */
 int
-dup3 (fd, fd2, flags)
+__dup3 (fd, fd2, flags)
      int fd;
      int fd2;
      int flags;
@@ -42,7 +42,8 @@ dup3 (fd, fd2, flags)
   __set_errno (ENOSYS);
   return -1;
 }
-libc_hidden_def (dup3)
+libc_hidden_def (__dup3)
+weak_alias (__dup3, dup3)
 stub_warning (dup3)
 
 #include <stub-tag.h>
index 025c55b655581484a47e61205bb2265a4f6bc19f..fa89c277c63c907b70bcedb0956d56638d56cb44 100644 (file)
@@ -89,9 +89,9 @@ freopen (filename, mode, fp)
          else
            newfd =
 # endif
-             dup3 (_IO_fileno (result), fd,
-                   (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
-                   ? O_CLOEXEC : 0);
+             __dup3 (_IO_fileno (result), fd,
+                      (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
+                      ? O_CLOEXEC : 0);
 #else
 # define newfd 1
 #endif
index 24d03606254d66e552bce4bb9a0686ffb0c47740..c28a9925f07798fc62785e7876d8b52943d7fc77 100644 (file)
@@ -73,9 +73,9 @@ freopen64 (filename, mode, fp)
          else
            newfd =
 # endif
-             dup3 (_IO_fileno (result), fd,
-                   (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
-                   ? O_CLOEXEC : 0);
+             __dup3 (_IO_fileno (result), fd,
+                      (result->_flags2 & _IO_FLAGS2_CLOEXEC) != 0
+                      ? O_CLOEXEC : 0);
 #else
 # define newfd 1
 #endif
index 5c696b31cbad8fe24d96a755ed2c2878c4174b5c..39c40ed7f6e2d3517c48b6aa18dc550081789be9 100644 (file)
@@ -10,7 +10,7 @@ chroot                -       chroot          i:s     chroot
 close          -       close           Ci:i    __libc_close    __close close
 dup            -       dup             i:i     __dup           dup
 dup2           -       dup2            i:ii    __dup2          dup2
-dup3           -       dup3            i:iii   dup3
+dup3           -       dup3            i:iii   __dup3          dup3
 fchdir         -       fchdir          i:i     __fchdir        fchdir
 fchmod         -       fchmod          i:ii    __fchmod        fchmod
 fchown         -       fchown          i:iii   __fchown        fchown