Skip to content

Commit

Permalink
[lldb] Fix an unused function warning
Browse files Browse the repository at this point in the history
This patch fixes:

  .../llvm-project/lldb/source/Host/common/PseudoTerminal.cpp:106:20:
  error: unused function 'use_ptsname' [-Werror,-Wunused-function]
  • Loading branch information
kazutakahirata committed May 25, 2022
1 parent 0c8fdd7 commit 4391625
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lldb/source/Host/common/PseudoTerminal.cpp
Expand Up @@ -103,13 +103,15 @@ llvm::Error PseudoTerminal::OpenSecondary(int oflag) {
std::error_code(errno, std::generic_category()));
}

#if !HAVE_PTSNAME_R || defined(__APPLE__)
static std::string use_ptsname(int fd) {
static std::mutex mutex;
std::lock_guard<std::mutex> guard(mutex);
const char *r = ptsname(fd);
assert(r != nullptr);
return r;
}
#endif

std::string PseudoTerminal::GetSecondaryName() const {
assert(m_primary_fd >= 0);
Expand Down

0 comments on commit 4391625

Please sign in to comment.