]> granicus.if.org Git - icinga2/commitdiff
Windows build fix.
authorGunnar Beutner <gunnar@beutner.name>
Fri, 1 Feb 2013 22:10:48 +0000 (23:10 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 1 Feb 2013 22:10:48 +0000 (23:10 +0100)
lib/base/i2-base.h
lib/base/unix.h
lib/config/configcompiler.cpp

index d09df3c1decd769f7906803ddbc51a9515bf6b42..2b27f51483e18c4831fc5db9166d2fdf3cc84ba4 100644 (file)
@@ -75,6 +75,9 @@
 #include <cassert>
 #include <cerrno>
 
+#include <sys/types.h>
+#include <sys/stat.h>
+
 #include <string>
 #include <exception>
 #include <stdexcept>
index 56ca602a5c6a4e39e55151b18b5f67d24bc5dbdd..09453a43c24846262153e58464a1238e80aedf23 100644 (file)
@@ -22,8 +22,6 @@
 
 #include <limits.h>
 #include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <sys/un.h>
index b209e409e7dcc5d111c315bd8d36a4cce60837b1..77f614fb57117f10f3e8884e1a567f01addec1df 100644 (file)
@@ -182,8 +182,13 @@ vector<ConfigItem::Ptr> ConfigCompiler::HandleFileInclude(const String& include,
                BOOST_FOREACH(const String& dir, m_IncludeSearchDirs) {
                        String path = dir + "/" + include;
 
+#ifndef _WIN32
                        struct stat statbuf;
                        if (lstat(path.CStr(), &statbuf) >= 0) {
+#else /* _WIN32 */
+                       struct _stat statbuf;
+                       if (_stat(path.CStr(), &statbuf) >= 0) {
+#endif /* _WIN32 */
                                includePath = path;
                                break;
                        }