]> granicus.if.org Git - icinga2/commitdiff
Compilation fixes for *NIX.
authorGunnar Beutner <gunnar@beutner.name>
Fri, 15 Jun 2012 17:52:39 +0000 (19:52 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 15 Jun 2012 17:56:28 +0000 (19:56 +0200)
base/application.cpp
base/i2-base.h
dyn/configcompiler.cpp

index 4f7f95c38f117bd15ad993b8a10fc81241012793..cab1bb579ac599f76082c33f603a1ffc755a1a7b 100644 (file)
@@ -353,6 +353,7 @@ string Application::GetExeDirectory(void) const
        if (getcwd(Cwd, sizeof(Cwd)) == NULL)
                throw PosixException("getcwd failed", errno);
 
+       // TODO:: C++ify this.
        if (argv0[0] != '/')
                snprintf(FullExePath, sizeof(FullExePath), "%s/%s", Cwd, argv0);
        else
@@ -365,7 +366,7 @@ string Application::GetExeDirectory(void) const
                        PathEnv = strdup(PathEnv);
 
                        if (PathEnv == NULL)
-                               throw bad_alloc();
+                               throw runtime_error("strdup failed");
 
                        FoundPath = false;
 
index c5182727dd939821d4c62e060900f3ea5ca9ee1c..a276ac43d3d6780dd578d34e93378917c2edd638 100644 (file)
@@ -120,7 +120,6 @@ using boost::enable_shared_from_this;
 using boost::dynamic_pointer_cast;
 using boost::static_pointer_cast;
 using boost::function;
-using boost::signal;
 
 #if defined(__APPLE__) && defined(__MACH__)
 #      pragma GCC diagnostic ignored "-Wdeprecated-declarations" 
index 08271920b835a6dc437cd0ae516d5bd5d6aef150..d27eb21bedefafec55e1cbc42767621d1c32c642 100644 (file)
@@ -66,7 +66,7 @@ vector<ConfigItem::Ptr> ConfigCompiler::CompileFile(const string& filename)
 {
        ifstream stream;
        stream.exceptions(ifstream::badbit);
-       stream.open(filename, ifstream::in);
+       stream.open(filename.c_str(), ifstream::in);
        return CompileStream(&stream);
 }