]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/socket.cpp
Fix building on Windows.
[user/henk/code/inspircd.git] / src / socket.cpp
index 1d110323567a589ca39d3a55c89a2c1884363540..5827b8b7743fb7c17c43123bba3cdc86bdd28f74 100644 (file)
@@ -93,6 +93,7 @@ int InspIRCd::BindPorts(FailedPortList& failed_ports)
                        continue;
                }
 
+#ifndef _WIN32
                // Are we creating a UNIX listener?
                const std::string path = tag->getString("path");
                if (!path.empty())
@@ -109,13 +110,14 @@ int InspIRCd::BindPorts(FailedPortList& failed_ports)
                        // 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();