summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-04-28 17:08:09 +0200
committerZdenek Prikryl <zdeny@dhcp-lab-218.englab.brq.redhat.com>2009-04-28 17:08:09 +0200
commit2e6a6e8aed825e456600d01c8a805b6f6fd24c3a (patch)
treec58cba2913350fed9674813b3fe0a27e6639fbd2 /src
parentb08d5c2cf630ecb89d2f22b985dcdfcf25494258 (diff)
downloadabrt-2e6a6e8aed825e456600d01c8a805b6f6fd24c3a.tar.gz
abrt-2e6a6e8aed825e456600d01c8a805b6f6fd24c3a.tar.xz
abrt-2e6a6e8aed825e456600d01c8a805b6f6fd24c3a.zip
new commlayerinner interface
Diffstat (limited to 'src')
-rw-r--r--src/Daemon/CrashWatcher.cpp10
-rw-r--r--src/Daemon/CrashWatcher.h4
-rw-r--r--src/Daemon/Makefile.am4
-rw-r--r--src/Hooks/CCpp.cpp13
-rw-r--r--src/Hooks/Makefile.am2
5 files changed, 17 insertions, 16 deletions
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index 85a705ca..0146fab4 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -30,7 +30,7 @@
#include <sstream>
#include <dirent.h>
#include <cstring>
-#include "CommLayer.h"
+#include "ABRTCommLayer.h"
#include "ABRTException.h"
/* just a helper function
@@ -212,11 +212,10 @@ CCrashWatcher::CCrashWatcher(const std::string& pPath)
int watch = 0;
m_sTarget = pPath;
- // TODO: initialize object according parameters -w -i
+ // TODO: initialize object according parameters -w -d
// status has to be always created.
- CommLayerInner::init_status(this);
- CommLayerInner::init_warning(this);
- CommLayerInner::init_debug(this);
+ m_pCommLayerInner = new CCommLayerInner(this, true, true);
+ ABRTCommLayer::init_comm_layer_inner(m_pCommLayerInner);
m_pSettings = new CSettings();
m_pSettings->LoadSettings(std::string(CONF_DIR) + "/abrt.conf");
@@ -255,6 +254,7 @@ CCrashWatcher::~CCrashWatcher()
delete m_pCommLayer;
delete m_pMW;
delete m_pSettings;
+ delete m_pCommLayerInner;
}
void CCrashWatcher::FindNewDumps(const std::string& pPath)
{
diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h
index d20cecff..deba9014 100644
--- a/src/Daemon/CrashWatcher.h
+++ b/src/Daemon/CrashWatcher.h
@@ -28,7 +28,6 @@
//#include "DBusServerProxy.h"
#include "MiddleWare.h"
#include "Settings.h"
-#include "CommLayerInner.h"
//FIXME remove when it gets to autoconf
#include "CommLayerServerDBus.h"
@@ -37,11 +36,11 @@
#elif HAVE_SOCKET
#include "CommLayerServerSocket.h"
#endif
+#include "CommLayerInner.h"
// 1024 simultaneous actions
#define INOTIFY_BUFF_SIZE ((sizeof(struct inotify_event)+FILENAME_MAX)*1024)
-
class CCrashWatcher
//: public CDBusServer_adaptor,
// public DBus::IntrospectableAdaptor,
@@ -64,6 +63,7 @@ class CCrashWatcher
std::string m_sTarget;
CMiddleWare *m_pMW;
CCommLayerServer *m_pCommLayer;
+ CCommLayerInner *m_pCommLayerInner;
/*FIXME not needed */
//DBus::Connection *m_pConn;
CSettings *m_pSettings;
diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am
index ca3a4703..84013d49 100644
--- a/src/Daemon/Makefile.am
+++ b/src/Daemon/Makefile.am
@@ -1,8 +1,8 @@
sbin_PROGRAMS = abrt
abrt_SOURCES = CrashWatcher.cpp CrashWatcher.h Daemon.cpp DBusServerProxy.h \
DBusCommon.h Settings.h Settings.cpp
-abrt_CPPFLAGS = -Wall -Werror -rdynamic -I../../lib/MiddleWare -I../../lib/CommLayer\
- -I../../lib/DBus -I../../lib/Utils\
+abrt_CPPFLAGS = -Wall -Werror -rdynamic -I$(srcdir)/../../lib/MiddleWare -I$(srcdir)/../../lib/CommLayer\
+ -I$(srcdir)/../../inc -I$(srcdir)/../../lib/Utils\
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(GLIB_CFLAGS) $(DBUSCPP_CFLAGS) \
-DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \
-DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \
diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp
index 646beaff..05e0b568 100644
--- a/src/Hooks/CCpp.cpp
+++ b/src/Hooks/CCpp.cpp
@@ -20,6 +20,7 @@
*/
#include "DebugDump.h"
+#include "ABRTException.h"
#include <stdlib.h>
#include <string.h>
#include <limits.h>
@@ -132,7 +133,7 @@ int main(int argc, char** argv)
{
free(executable);
free(cmdline);
- throw std::string("Can not get proc info.");
+ throw CABRTException(EXCEP_FATAL, "Can not get proc info.");
}
snprintf(path, sizeof(path), "%s/ccpp-%ld-%s", dddir, time(NULL), pid);
@@ -148,7 +149,7 @@ int main(int argc, char** argv)
{
dd.Delete();
dd.Close();
- throw std::string("Can not open the file ") + path;
+ throw CABRTException(EXCEP_FATAL, std::string("Can not open the file ") + path);
}
// TODO: rewrite this
while ((byte = getc(stdin)) != EOF)
@@ -158,7 +159,7 @@ int main(int argc, char** argv)
fclose(fp);
dd.Delete();
dd.Close();
- throw std::string("Can not write to the file %s.");
+ throw CABRTException(EXCEP_FATAL, "Can not write to the file %s.");
}
}
@@ -168,10 +169,10 @@ int main(int argc, char** argv)
dd.Close();
write_success_log(pid);
}
- catch (std::string sError)
+ catch (std::exception& e)
{
- fprintf(stderr, "%s: %s\n", program_name, sError.c_str());
- write_faliure_log(sError.c_str());
+ fprintf(stderr, "%s: %s\n", program_name, e.what());
+ write_faliure_log(e.what());
return -2;
}
return 0;
diff --git a/src/Hooks/Makefile.am b/src/Hooks/Makefile.am
index 48d34e84..88361c6b 100644
--- a/src/Hooks/Makefile.am
+++ b/src/Hooks/Makefile.am
@@ -3,5 +3,5 @@ libexec_PROGRAMS = hookCCpp
# CCpp
hookCCpp_SOURCES = CCpp.cpp
hookCCpp_LDADD = ../../lib/Utils/libABRTUtils.la
-hookCCpp_CPPFLAGS = -I$(srcdir)/../../lib/Utils \
+hookCCpp_CPPFLAGS = -I$(srcdir)/../../inc -I$(srcdir)/../../lib/Utils \
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\"