Skip to content

Commit

Permalink
base: Disable __close overloading for Musl
Browse files Browse the repository at this point in the history
  • Loading branch information
klzgrad committed Oct 1, 2022
1 parent 01a2dd2 commit 829aaf8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/base/files/scoped_file_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ bool IsFDOwned(int fd) {

extern "C" {

#if !defined(__MUSL__)
int __close(int);

__attribute__((visibility("default"), noinline)) int close(int fd) {
if (base::IsFDOwned(fd) && g_is_ownership_enforced)
CrashOnFdOwnershipViolation();
return __close(fd);
}
#endif

} // extern "C"

0 comments on commit 829aaf8

Please sign in to comment.