summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2014-06-05 15:12:42 +0000
committerDmitry V. Levin <ldv@altlinux.org>2014-06-05 15:42:05 +0000
commitc903c822ee94478bff1732eb80744e201c074d26 (patch)
tree614a26ae322b3cb4a994b9678f4d27c600afa996
parente4113974893293c82f177fe4195cac0a5b70465a (diff)
downloadstrace-c903c822ee94478bff1732eb80744e201c074d26.tar.gz
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.
-rw-r--r--unwind.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/unwind.c b/unwind.c
index 21f2a4818..d23fef667 100644
--- a/unwind.c
+++ b/unwind.c
@@ -28,6 +28,16 @@
#include <limits.h>
#include <libunwind-ptrace.h>
+#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;