]> granicus.if.org Git - icinga2/commitdiff
Build fix for Windows and RHEL 5
authorGunnar Beutner <gunnar@beutner.name>
Thu, 23 Oct 2014 17:07:14 +0000 (19:07 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Thu, 23 Oct 2014 17:07:14 +0000 (19:07 +0200)
fixes #7433

lib/cli/agentblackandwhitelistcommand.cpp
lib/cli/agentblackandwhitelistcommand.hpp
lib/cli/repositoryobjectcommand.cpp
lib/cli/repositoryobjectcommand.hpp
lib/cli/repositoryutility.cpp

index 5bf21f1897c921fb40b2e2cb686ee61bb339244d..506175a17fbbc22e827d2f451fce05a9411579d5 100644 (file)
@@ -27,8 +27,8 @@
 using namespace icinga;
 namespace po = boost::program_options;
 
-REGISTER_BLACKANDWHITELIST_CLICOMMAND("whitelist");
-REGISTER_BLACKANDWHITELIST_CLICOMMAND("blacklist");
+REGISTER_BLACKANDWHITELIST_CLICOMMAND(whitelist);
+REGISTER_BLACKANDWHITELIST_CLICOMMAND(blacklist);
 
 RegisterBlackAndWhitelistCLICommandHelper::RegisterBlackAndWhitelistCLICommandHelper(const String& type)
 {
index 921dec5276e1e2759790c9640aebdd60c8c71ce4..cd103660e25957eaef30eafcd0e959512c074490 100644 (file)
@@ -68,7 +68,7 @@ public:
 
 #define REGISTER_BLACKANDWHITELIST_CLICOMMAND(type) \
        namespace { namespace UNIQUE_NAME(blackandwhitelist) { \
-               I2_EXPORT icinga::RegisterBlackAndWhitelistCLICommandHelper l_RegisterBlackAndWhitelistCLICommand(type); \
+               I2_EXPORT icinga::RegisterBlackAndWhitelistCLICommandHelper l_RegisterBlackAndWhitelistCLICommand_ ## type(#type); \
        } }
 
 }
index a623a44a8cedd72c230b8ba4cb015e939c8e1558..c8db201740a99ef3a2de0394edc8fbbe9b969939 100644 (file)
 using namespace icinga;
 namespace po = boost::program_options;
 
-REGISTER_REPOSITORY_CLICOMMAND("Host");
-REGISTER_REPOSITORY_CLICOMMAND("Service");
-REGISTER_REPOSITORY_CLICOMMAND("Zone");
-REGISTER_REPOSITORY_CLICOMMAND("Endpoint");
+REGISTER_REPOSITORY_CLICOMMAND(Host);
+REGISTER_REPOSITORY_CLICOMMAND(Service);
+REGISTER_REPOSITORY_CLICOMMAND(Zone);
+REGISTER_REPOSITORY_CLICOMMAND(Endpoint);
 
 RegisterRepositoryCLICommandHelper::RegisterRepositoryCLICommandHelper(const String& type)
 {
index 4b9f833970d83ba63a6312adfdc20e1b96b6d570..8cf33ba13b5a4f8ec7b6e991753e648fe6affa26 100644 (file)
@@ -70,7 +70,7 @@ public:
 
 #define REGISTER_REPOSITORY_CLICOMMAND(type) \
        namespace { namespace UNIQUE_NAME(repositoryobject) { \
-               I2_EXPORT icinga::RegisterRepositoryCLICommandHelper l_RegisterRepositoryCLICommand(type); \
+               I2_EXPORT icinga::RegisterRepositoryCLICommandHelper l_RegisterRepositoryCLICommand_ ## type(#type); \
        } }
 
 }
index 584d5854c3419e28871b36fcfa4cb5a69bb889b7..64a807bc68abc876e48ecf2bf48cf3169c349ff7 100644 (file)
@@ -30,6 +30,7 @@
 #include "base/console.hpp"
 #include <boost/foreach.hpp>
 #include <boost/algorithm/string/join.hpp>
+#include <boost/algorithm/string/replace.hpp>
 #include <fstream>
 #include <iostream>
 
@@ -206,7 +207,7 @@ bool RepositoryUtility::WriteObjectToRepository(const String& path, const String
         fp.close();
 
 #ifdef _WIN32
-       _unlink(filename.CStr());
+       _unlink(path.CStr());
 #endif /* _WIN32 */
 
        if (rename(tempPath.CStr(), path.CStr()) < 0) {
@@ -238,7 +239,7 @@ bool RepositoryUtility::WriteObjectToRepositoryChangeLog(const String& path, con
         fp.close();
 
 #ifdef _WIN32
-       _unlink(filename.CStr());
+       _unlink(path.CStr());
 #endif /* _WIN32 */
 
        if (rename(tempPath.CStr(), path.CStr()) < 0) {