diff options
author | Jon Medhurst <tixy@linaro.org> | 2013-01-14 08:34:37 +0000 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2013-01-15 11:01:37 +0000 |
commit | 10443d8e335e2ae4bb73d62f2e60484122fc6769 (patch) | |
tree | 8cc885bc69817dac112793467af0e37d7af5298c /daemon/main.cpp | |
parent | ee4f56e0d75f42583505dd338d1b91e67ff0ab53 (diff) |
gator: Version 5.13DS-5.13
Signed-off-by: Jon Medhurst <tixy@linaro.org>
Diffstat (limited to 'daemon/main.cpp')
-rw-r--r-- | daemon/main.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/daemon/main.cpp b/daemon/main.cpp index 5bc75ef..894bad7 100644 --- a/daemon/main.cpp +++ b/daemon/main.cpp @@ -19,6 +19,8 @@ #include <sys/mount.h> #include <fcntl.h> #include <sys/mman.h> +#include <sys/time.h> +#include <sys/resource.h> #include "Child.h" #include "SessionData.h" #include "OlySocket.h" @@ -28,7 +30,6 @@ #define DEBUG false extern Child* child; -extern void handleException(); int shutdownFilesystem(); static pthread_mutex_t numSessions_mutex; static int numSessions = 0; @@ -297,7 +298,10 @@ struct cmdline_t parseCommandLine(int argc, char** argv) { // Gator data flow: collector -> collector fifo -> sender int main(int argc, char** argv, char* envp[]) { + // Ensure proper signal handling by making gatord the process group leader + // e.g. it may not be the group leader when launched as 'sudo gatord' setsid(); + gSessionData = new SessionData(); // Global data class logg = new Logging(DEBUG); // Set up global thread-safe logging util = new OlyUtility(); // Set up global utility class @@ -314,9 +318,6 @@ int main(int argc, char** argv, char* envp[]) { logg->logMessage("setpriority() failed"); } - // Initialize session data - gSessionData->initialize(); - // Parse the command line parameters struct cmdline_t cmdline = parseCommandLine(argc, argv); |