diff options
author | Dmitry V. Levin <ldv@altlinux.org> | 2014-02-26 00:01:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2014-02-26 00:01:00 +0000 |
commit | d354130b3ac060051b55cda46c45ab5f5574548d (patch) | |
tree | b2ed90d03309de776cea1cdd1289288c33b9b914 | |
parent | a78d777c869829a3f0320e1793adb44fb57ac950 (diff) | |
download | strace-d354130b3ac060051b55cda46c45ab5f5574548d.tar.gz strace-d354130b3ac060051b55cda46c45ab5f5574548d.tar.bz2 strace-d354130b3ac060051b55cda46c45ab5f5574548d.tar.xz |
Fix build with Bionic libc
Add generic tests for fopen64 and fputs_unlocked functions to fix build
with Bionic libc that does not provide them.
* configure.ac (AC_CHECK_FUNCS): Add fopen64 and fputs_unlocked.
* strace.c [_LARGEFILE64_SOURCE]: Use fopen instead of fopen64
if !HAVE_FOPEN64.
Use fputs instead of fputs_unlocked if !HAVE_FPUTS_UNLOCKED.
* vsprintf.c: Use fputs instead of fputs_unlocked
if !HAVE_FPUTS_UNLOCKED.
Reported-by: Elliott Hughes <enh@google.com>
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | strace.c | 10 | ||||
-rw-r--r-- | vsprintf.c | 4 |
3 files changed, 15 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index db24349..75eafc8 100644 --- a/configure.ac +++ b/configure.ac @@ -196,7 +196,9 @@ AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, AC_LITTLE_ENDIAN_LONG_LONG AC_CHECK_FUNCS(m4_normalize([ + fopen64 fork + fputs_unlocked if_indextoname inet_ntop prctl @@ -439,7 +439,11 @@ swap_uid(void) } #ifdef _LARGEFILE64_SOURCE -# define fopen_for_output fopen64 +# ifdef HAVE_FOPEN64 +# define fopen_for_output fopen64 +# else +# define fopen_for_output fopen +# endif # define struct_stat struct stat64 # define stat_file stat64 # define struct_dirent struct dirent64 @@ -537,6 +541,10 @@ tprintf(const char *fmt, ...) va_end(args); } +#ifndef HAVE_FPUTS_UNLOCKED +# define fputs_unlocked fputs +#endif + void tprints(const char *str) { @@ -16,6 +16,10 @@ #include <stdarg.h> #include <limits.h> +#ifndef HAVE_FPUTS_UNLOCKED +# define fputs_unlocked fputs +#endif + #define noinline_for_stack /*nothing*/ #define likely(expr) (expr) #define unlikely(expr) (expr) |