Skip to content

Commit 57663aa

Browse files
[BOLT] close map_files FD
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.
1 parent e4a1b5f commit 57663aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bolt/runtime/instr.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,9 +714,11 @@ static char *getBinaryPath() {
714714
uint32_t Ret = __readlink(FindBuf, TargetPath, sizeof(TargetPath));
715715
assert(Ret != -1 && Ret != BufSize, "readlink error");
716716
TargetPath[Ret] = '\0';
717+
__close(FDdir);
717718
return TargetPath;
718719
}
719720
}
721+
__close(FDdir);
720722
return nullptr;
721723
}
722724

0 commit comments

Comments
 (0)