Skip to content

Commit

Permalink
Handle pidfd_getfd returning EBADF when the target process has been k…
Browse files Browse the repository at this point in the history
…illed
  • Loading branch information
rocallahan committed Oct 31, 2023
1 parent 591aa34 commit c835873
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/AutoRemoteSyscalls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,10 @@ template <typename Arch> ScopedFd AutoRemoteSyscalls::retrieve_fd_arch(int fd) {
if (ret.is_open()) {
return ret;
}
if (errno == EBADF) {
// This can happen when the child was unexpectedly killed.
return ret;
}
ASSERT(t, errno == ENOSYS) << "Failed in pidfd_getfd errno=" << errno_name(errno);
}

Expand Down

0 comments on commit c835873

Please sign in to comment.