[BOLT] close map_files FD (#156489)

The BOLT runtime currently does not close the FD pointing to
/proc/self/map_files. This does not actually hurt anything but was at
least a bit of a red herring for me when looking through strace on a
BOLT instrumented binary.
This commit is contained in:
Aiden Grossman 2025-09-03 06:00:10 -07:00 committed by GitHub
parent d29dc18992
commit 3f4d116978
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -714,9 +714,11 @@ static char *getBinaryPath() {
uint32_t Ret = __readlink(FindBuf, TargetPath, sizeof(TargetPath));
assert(Ret != -1 && Ret != BufSize, "readlink error");
TargetPath[Ret] = '\0';
__close(FDdir);
return TargetPath;
}
}
__close(FDdir);
return nullptr;
}