diff options
Diffstat (limited to 'src/socket.cpp')
-rw-r--r-- | src/socket.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/socket.cpp b/src/socket.cpp index abccd0408..2daa6a821 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -189,6 +189,17 @@ bool irc::sockets::untosa(const std::string& path, irc::sockets::sockaddrs& sa) return true; } +bool irc::sockets::isunix(const std::string& file) +{ +#ifndef _WIN32 + struct stat sb; + if (stat(file.c_str(), &sb) == 0 && S_ISSOCK(sb.st_mode)) + return true; +#endif + return false; +} + + int irc::sockets::sockaddrs::family() const { return sa.sa_family; |