From: Julian Seward Date: Thu, 7 Oct 2010 09:56:19 +0000 (+0000) Subject: Only use VKI_O_LARGEFILE on platforms where it exists. This X-Git-Tag: svn/VALGRIND_3_6_0~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d1bad49f00802a8f2133041e54a03203fdc0444f;p=thirdparty%2Fvalgrind.git Only use VKI_O_LARGEFILE on platforms where it exists. This unbreaks the build breakage on Darwin introduced in r11397, which was a fix for #234064. The breakage was subsequently reported in #253420 and #253452, which this commit fixes. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11406 --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 28530e245f..73f311b71e 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -606,7 +606,7 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV ) DebugInfo* di; ULong di_handle; SysRes fd; - Int nread; + Int nread, oflags; HChar buf1k[1024]; Bool debug = False; SysRes statres; @@ -727,7 +727,11 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV ) /* Peer at the first few bytes of the file, to see if it is an ELF */ /* object file. Ignore the file if we do not have read permission. */ VG_(memset)(buf1k, 0, sizeof(buf1k)); - fd = VG_(open)( filename, VKI_O_RDONLY|VKI_O_LARGEFILE, 0 ); + oflags = VKI_O_RDONLY; +# if defined(VKI_O_LARGEFILE) + oflags |= VKI_O_LARGEFILE; +# endif + fd = VG_(open)( filename, oflags, 0 ); if (sr_isError(fd)) { if (sr_Err(fd) != VKI_EACCES) { DebugInfo fake_di;