return;
}
+#ifndef _WIN32
if (x->IPAddr.find('/') != std::string::npos)
{
struct stat sb;
if (stat(x->IPAddr.c_str(), &sb) == -1 || !S_ISSOCK(sb.st_mode))
ipvalid = false;
}
+#endif
if (x->IPAddr.find(':') != std::string::npos)
{
in6_addr n;
continue;
}
+#ifndef _WIN32
// Are we creating a UNIX listener?
const std::string path = tag->getString("path");
if (!path.empty())
// Create the bindspec manually (aptosa doesn't work with AF_UNIX yet).
memset(&bindspec, 0, sizeof(bindspec));
bindspec.un.sun_family = AF_UNIX;
- stpncpy(bindspec.un.sun_path, path.c_str(), sizeof(bindspec.un.sun_path) - 1);
+ memcpy(&bindspec.un.sun_path, path.c_str(), sizeof(bindspec.un.sun_path));
if (!BindPort(tag, bindspec, old_ports))
failed_ports.push_back(std::make_pair(bindspec, errno));
else
bound++;
}
+#endif
}
std::vector<ListenSocket*>::iterator n = ports.begin();
return sent;
return -1;
}
+
+// This wrapper is just so we don't need to do #ifdef _WIN32 everywhere in the socket code. It is
+// not actually used and does not need to be the same size as sockaddr_un on UNIX systems.
+struct sockaddr_un
+{
+ ADDRESS_FAMILY sun_family;
+ char sun_path[6];
+};