From: Paul Floyd Date: Thu, 13 Mar 2025 19:47:28 +0000 (+0100) Subject: Darwin: close fd after call to ML_(check_macho_and_get_rw_loads) X-Git-Tag: VALGRIND_3_25_0~102 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ba2fe4f7d16f5880035e3d4154f72e60df19eea;p=thirdparty%2Fvalgrind.git Darwin: close fd after call to ML_(check_macho_and_get_rw_loads) I missed changing the code so that the VG_(close) happens for all platforms, not just non-Darwin. --- diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index 18fd33535..cd0472090 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -1349,26 +1349,22 @@ ULong VG_(di_notify_mmap)( Addr a, Bool allow_SkFileV, Int use_fd ) expected_rw_load_count = 0; + Bool check_ok = False; #if defined(VGO_darwin) - if (!ML_(check_macho_and_get_rw_loads)( actual_fd, &expected_rw_load_count )) - return 0; -#endif - + check_ok = ML_(check_macho_and_get_rw_loads)( actual_fd, &expected_rw_load_count ); +#else /* We're only interested in mappings of object files. */ -# if defined(VGO_linux) || defined(VGO_solaris) || defined(VGO_freebsd) - - Bool elf_ok = ML_(check_elf_and_get_rw_loads) ( actual_fd, filename, &expected_rw_load_count, use_fd == -1 ); + check_ok = ML_(check_elf_and_get_rw_loads) ( actual_fd, filename, &expected_rw_load_count, use_fd == -1 ); +#endif if (use_fd == -1) { VG_(close)( actual_fd ); } - if (!elf_ok) { + if (!check_ok) { return 0; } -# endif - /* See if we have a DebugInfo for this filename. If not, create one. */ di = find_or_create_DebugInfo_for( filename );