mirror of https://github.com/Icinga/icinga2.git
Compilation fixes for *NIX.
This commit is contained in:
parent
0bd5323629
commit
9ab3f6aaba
|
@ -353,6 +353,7 @@ string Application::GetExeDirectory(void) const
|
||||||
if (getcwd(Cwd, sizeof(Cwd)) == NULL)
|
if (getcwd(Cwd, sizeof(Cwd)) == NULL)
|
||||||
throw PosixException("getcwd failed", errno);
|
throw PosixException("getcwd failed", errno);
|
||||||
|
|
||||||
|
// TODO:: C++ify this.
|
||||||
if (argv0[0] != '/')
|
if (argv0[0] != '/')
|
||||||
snprintf(FullExePath, sizeof(FullExePath), "%s/%s", Cwd, argv0);
|
snprintf(FullExePath, sizeof(FullExePath), "%s/%s", Cwd, argv0);
|
||||||
else
|
else
|
||||||
|
@ -365,7 +366,7 @@ string Application::GetExeDirectory(void) const
|
||||||
PathEnv = strdup(PathEnv);
|
PathEnv = strdup(PathEnv);
|
||||||
|
|
||||||
if (PathEnv == NULL)
|
if (PathEnv == NULL)
|
||||||
throw bad_alloc();
|
throw runtime_error("strdup failed");
|
||||||
|
|
||||||
FoundPath = false;
|
FoundPath = false;
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,6 @@ using boost::enable_shared_from_this;
|
||||||
using boost::dynamic_pointer_cast;
|
using boost::dynamic_pointer_cast;
|
||||||
using boost::static_pointer_cast;
|
using boost::static_pointer_cast;
|
||||||
using boost::function;
|
using boost::function;
|
||||||
using boost::signal;
|
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
#if defined(__APPLE__) && defined(__MACH__)
|
||||||
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
|
@ -66,7 +66,7 @@ vector<ConfigItem::Ptr> ConfigCompiler::CompileFile(const string& filename)
|
||||||
{
|
{
|
||||||
ifstream stream;
|
ifstream stream;
|
||||||
stream.exceptions(ifstream::badbit);
|
stream.exceptions(ifstream::badbit);
|
||||||
stream.open(filename, ifstream::in);
|
stream.open(filename.c_str(), ifstream::in);
|
||||||
return CompileStream(&stream);
|
return CompileStream(&stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue