mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 20:16:03 +01:00
Don't build getPtsName() on Windows
It's not needed. https://hydra.nixos.org/build/309215536
This commit is contained in:
parent
5e65584edf
commit
8aa0acb9e8
1 changed files with 5 additions and 3 deletions
|
|
@ -179,9 +179,10 @@ std::pair<unsigned short, unsigned short> getWindowSize()
|
||||||
return *windowSize.lock();
|
return *windowSize.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
std::string getPtsName(int fd)
|
std::string getPtsName(int fd)
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
# ifdef __APPLE__
|
||||||
static std::mutex ptsnameMutex;
|
static std::mutex ptsnameMutex;
|
||||||
// macOS doesn't have ptsname_r, use mutex-protected ptsname
|
// macOS doesn't have ptsname_r, use mutex-protected ptsname
|
||||||
std::lock_guard<std::mutex> lock(ptsnameMutex);
|
std::lock_guard<std::mutex> lock(ptsnameMutex);
|
||||||
|
|
@ -190,7 +191,7 @@ std::string getPtsName(int fd)
|
||||||
throw SysError("getting pseudoterminal slave name");
|
throw SysError("getting pseudoterminal slave name");
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
#else
|
# else
|
||||||
// Use thread-safe ptsname_r on platforms that support it
|
// Use thread-safe ptsname_r on platforms that support it
|
||||||
// PTY names are typically short:
|
// PTY names are typically short:
|
||||||
// - Linux: /dev/pts/N (where N is usually < 1000)
|
// - Linux: /dev/pts/N (where N is usually < 1000)
|
||||||
|
|
@ -201,7 +202,8 @@ std::string getPtsName(int fd)
|
||||||
throw SysError("getting pseudoterminal slave name");
|
throw SysError("getting pseudoterminal slave name");
|
||||||
}
|
}
|
||||||
return buf;
|
return buf;
|
||||||
#endif
|
# endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace nix
|
} // namespace nix
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue