]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Only use VKI_O_LARGEFILE on platforms where it exists. This
authorJulian Seward <jseward@acm.org>
Thu, 7 Oct 2010 09:56:19 +0000 (09:56 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 7 Oct 2010 09:56:19 +0000 (09:56 +0000)
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

coregrind/m_debuginfo/debuginfo.c

index 28530e245f2b2ffff49b5439de3a1e9a541c12da..73f311b71e76c41504f093782c155c3049187175 100644 (file)
@@ -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;