From 2747bf9adfd7bee7a44bb75c0279a88a1c89df30 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 1 Aug 2012 16:30:47 -0700 Subject: [PATCH] Clean up fopen64 for O_LARGEFILE==0. --- ChangeLog | 11 +++++++++++ libio/iofopen.c | 6 ++++++ libio/iofopen64.c | 6 ++++++ sysdeps/wordsize-64/iofopen.c | 4 ---- sysdeps/wordsize-64/iofopen64.c | 1 - 5 files changed, 23 insertions(+), 5 deletions(-) delete mode 100644 sysdeps/wordsize-64/iofopen.c delete mode 100644 sysdeps/wordsize-64/iofopen64.c diff --git a/ChangeLog b/ChangeLog index 7ddd56b..386eeb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-08-01 Roland McGrath + + * libio/iofopen.c: Include . + [_LIBC] [!defined O_LARGEFILE || O_LARGEFILE == 0] + (_IO_fopen64, fopen64): Define as aliases. + * libio/iofopen64.c: Include . + [!defined _LIBC || (defined O_LARGEFILE && O_LARGEFILE != 0)]: + Conditionalize body on this. + * sysdeps/wordsize-64/iofopen.c: File removed. + * sysdeps/wordsize-64/iofopen64.c: File removed. + 2012-08-01 Marek Polacek * libc/Makeconfig: Use elf in place of binfmt-subdir. diff --git a/libio/iofopen.c b/libio/iofopen.c index 8edd32e..a7e69e4 100644 --- a/libio/iofopen.c +++ b/libio/iofopen.c @@ -25,6 +25,7 @@ in files containing the exception. */ #include "libioP.h" +#include #include #include #ifdef _LIBC @@ -106,4 +107,9 @@ _IO_new_fopen (filename, mode) strong_alias (_IO_new_fopen, __new_fopen) versioned_symbol (libc, _IO_new_fopen, _IO_fopen, GLIBC_2_1); versioned_symbol (libc, __new_fopen, fopen, GLIBC_2_1); + +# if !defined O_LARGEFILE || O_LARGEFILE == 0 +weak_alias (_IO_new_fopen, _IO_fopen64) +weak_alias (_IO_new_fopen, fopen64) +# endif #endif diff --git a/libio/iofopen64.c b/libio/iofopen64.c index 1b1a487..25c79c9 100644 --- a/libio/iofopen64.c +++ b/libio/iofopen64.c @@ -25,8 +25,12 @@ in files containing the exception. */ #include "libioP.h" +#include #include +/* iofopen.c defines _IO_fopen64/fopen64 as aliases if O_LARGEFILE==0. */ +#if !defined _LIBC || (defined O_LARGEFILE && O_LARGEFILE != 0) + _IO_FILE * _IO_fopen64 (filename, mode) const char *filename; @@ -43,3 +47,5 @@ _IO_fopen64 (filename, mode) #ifdef weak_alias weak_alias (_IO_fopen64, fopen64) #endif + +#endif diff --git a/sysdeps/wordsize-64/iofopen.c b/sysdeps/wordsize-64/iofopen.c deleted file mode 100644 index d8d92ca..0000000 --- a/sysdeps/wordsize-64/iofopen.c +++ /dev/null @@ -1,4 +0,0 @@ -#include "../../libio/iofopen.c" - -weak_alias (_IO_new_fopen, _IO_fopen64) -weak_alias (_IO_new_fopen, fopen64) diff --git a/sysdeps/wordsize-64/iofopen64.c b/sysdeps/wordsize-64/iofopen64.c deleted file mode 100644 index 68315d8..0000000 --- a/sysdeps/wordsize-64/iofopen64.c +++ /dev/null @@ -1 +0,0 @@ -/* Defined in iofopen.c. */ -- 2.7.4