[icinga-checkins] icinga.org: icinga2/master: Windows build fix.

git at icinga.org git at icinga.org
Fri Feb 1 23:10:52 CET 2013


Module: icinga2
Branch: master
Commit: 04fd703e6a2d58333e837a8466efe5511db1cb5c
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=04fd703e6a2d58333e837a8466efe5511db1cb5c

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Fri Feb  1 23:10:48 2013 +0100

Windows build fix.

---

 lib/base/i2-base.h            |    3 +++
 lib/base/unix.h               |    2 --
 lib/config/configcompiler.cpp |    5 +++++
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/base/i2-base.h b/lib/base/i2-base.h
index d09df3c..2b27f51 100644
--- a/lib/base/i2-base.h
+++ b/lib/base/i2-base.h
@@ -75,6 +75,9 @@
 #include <cassert>
 #include <cerrno>
 
+#include <sys/types.h>
+#include <sys/stat.h>
+
 #include <string>
 #include <exception>
 #include <stdexcept>
diff --git a/lib/base/unix.h b/lib/base/unix.h
index 56ca602..09453a4 100644
--- a/lib/base/unix.h
+++ b/lib/base/unix.h
@@ -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>
diff --git a/lib/config/configcompiler.cpp b/lib/config/configcompiler.cpp
index b209e40..77f614f 100644
--- a/lib/config/configcompiler.cpp
+++ b/lib/config/configcompiler.cpp
@@ -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;
 			}





More information about the icinga-checkins mailing list