From: Dmitry V. Levin Date: Thu, 5 Jun 2014 15:12:42 +0000 (+0000) Subject: unwind: use fopen64 instead of fopen X-Git-Tag: v4.9~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c903c822ee94478bff1732eb80744e201c074d26;p=strace unwind: use fopen64 instead of fopen * unwind.c (fopen_for_input): Define to fopen64 iff [_LARGEFILE64_SOURCE && HAVE_FOPEN64], otherwise define it to fopen. (build_mmap_cache): Use fopen_for_input instead of fopen. --- diff --git a/unwind.c b/unwind.c index 21f2a481..d23fef66 100644 --- a/unwind.c +++ b/unwind.c @@ -28,6 +28,16 @@ #include #include +#ifdef _LARGEFILE64_SOURCE +# ifdef HAVE_FOPEN64 +# define fopen_for_input fopen64 +# else +# define fopen_for_input fopen +# endif +#else +# define fopen_for_input fopen +#endif + #define DPRINTF(F, A, ...) if (debug_flag) fprintf(stderr, " [unwind(" A ")] " F "\n", __VA_ARGS__) /* @@ -143,7 +153,7 @@ build_mmap_cache(struct tcb* tcp) unw_flush_cache (libunwind_as, 0, 0); sprintf(filename, "/proc/%d/maps", tcp->pid); - fp = fopen(filename, "r"); + fp = fopen_for_input(filename, "r"); if (!fp) { perror_msg("fopen: %s", filename); return;