summaryrefslogtreecommitdiff
path: root/ambd
diff options
context:
space:
mode:
Diffstat (limited to 'ambd')
-rw-r--r--ambd/main.cpp7
-rw-r--r--ambd/pluginloader.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/ambd/main.cpp b/ambd/main.cpp
index d39c2d68..ff5eb9cf 100644
--- a/ambd/main.cpp
+++ b/ambd/main.cpp
@@ -201,6 +201,13 @@ void daemonize()
{
close(i); // close all descriptors
}
+
+
+ // handle standard I/O
+ i = open("/dev/null", O_RDWR);
+ dup2(i, STDIN_FILENO);
+ dup2(i, STDOUT_FILENO);
+ dup2(i, STDERR_FILENO);
{ // handle standard I/O
i = open("/dev/null", O_RDWR);
dup(i);
diff --git a/ambd/pluginloader.cpp b/ambd/pluginloader.cpp
index dd1d2ed1..50e15c62 100644
--- a/ambd/pluginloader.cpp
+++ b/ambd/pluginloader.cpp
@@ -48,7 +48,7 @@ std::string get_file_contents(const char *filename)
return output;
}
-PluginLoader::PluginLoader(string configFile, int argc, char** argv): f_create(NULL), routingEngine(nullptr), mMainLoop(nullptr)
+PluginLoader::PluginLoader(string configFile, int argc, char** argv): routingEngine(nullptr), f_create(NULL), mMainLoop(nullptr)
{
DebugOut()<<"Loading config file: "<<configFile<<endl;
std::string configBuffer = get_file_contents(configFile.c_str());