summaryrefslogtreecommitdiffstats
path: root/src/Daemon
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-03-03 21:04:08 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2009-03-03 21:04:08 +0100
commit0a5b87ab4dae3ec4b47a47d505f89fc3e3e3055f (patch)
tree560f589061acce46928ea03ae6602364002423ee /src/Daemon
parent820832e32b5ee5f422261575fc332e038ad94e73 (diff)
downloadabrt-0a5b87ab4dae3ec4b47a47d505f89fc3e3e3055f.tar.gz
abrt-0a5b87ab4dae3ec4b47a47d505f89fc3e3e3055f.tar.xz
abrt-0a5b87ab4dae3ec4b47a47d505f89fc3e3e3055f.zip
Rename to abrt
Diffstat (limited to 'src/Daemon')
-rw-r--r--src/Daemon/CrashWatcher.cpp34
-rw-r--r--src/Daemon/CrashWatcher.h4
-rw-r--r--src/Daemon/Makefile.am12
-rw-r--r--src/Daemon/dbus-abrt.conf (renamed from src/Daemon/dbus-crash-catcher.conf)0
4 files changed, 33 insertions, 17 deletions
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index 5eb7705..114400c 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -69,10 +69,17 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition,
std::string sName = name;
CCrashWatcher *cc = (CCrashWatcher*)daemon;
crash_info_t crashinfo;
- if(cc->m_pMW->SaveDebugDump(std::string(DEBUG_DUMPS_DIR) + "/" + name, crashinfo))
+ try
{
- /* send message to dbus */
- cc->Crash(crashinfo.m_sPackage);
+ if(cc->m_pMW->SaveDebugDump(std::string(DEBUG_DUMPS_DIR) + "/" + name, crashinfo))
+ {
+ /* send message to dbus */
+ cc->Crash(crashinfo.m_sPackage);
+ }
+ }
+ catch(std::string err)
+ {
+ std::cerr << err << std::endl;
}
}
#ifdef DEBUG
@@ -93,8 +100,8 @@ CCrashWatcher::CCrashWatcher(const std::string& pPath,DBus::Connection &connecti
int watch = 0;
m_sTarget = pPath;
// middleware object
- m_pMW = new CMiddleWare(PLUGINS_CONF_DIR,PLUGINS_LIB_DIR, std::string(CONF_DIR) + "/crash-catcher.conf");
- m_nMainloop = g_main_loop_new(NULL,FALSE);
+ m_pMW = new CMiddleWare(PLUGINS_CONF_DIR,PLUGINS_LIB_DIR, std::string(CONF_DIR) + "/abrt.conf");
+ m_pMainloop = g_main_loop_new(NULL,FALSE);
connection.request_name(CC_DBUS_NAME);
if((m_nFd = inotify_init()) == -1){
throw std::string("Init Failed");
@@ -105,13 +112,15 @@ CCrashWatcher::CCrashWatcher(const std::string& pPath,DBus::Connection &connecti
throw std::string("Add watch failed:") + pPath.c_str();
}
- m_nGio = g_io_channel_unix_new(m_nFd);
+ m_pGio = g_io_channel_unix_new(m_nFd);
}
CCrashWatcher::~CCrashWatcher()
{
//delete dispatcher, connection, etc..
delete m_pMW;
+ g_io_channel_unref(m_pGio);
+ g_main_loop_unref(m_pMainloop);
}
dbus_vector_crash_infos_t CCrashWatcher::GetCrashInfos(const std::string &pUID)
@@ -130,7 +139,14 @@ dbus_vector_map_crash_infos_t CCrashWatcher::GetCrashInfosMap(const std::string
dbus_vector_map_crash_infos_t retval;
vector_crash_infos_t crash_info;
unsigned long unix_uid = m_pConn->sender_unix_uid(pDBusSender.c_str());
- crash_info = m_pMW->GetCrashInfos(to_string(unix_uid));
+ try
+ {
+ crash_info = m_pMW->GetCrashInfos(to_string(unix_uid));
+ }
+ catch(std::string err)
+ {
+ std::cerr << err << std::endl;
+ }
for (vector_crash_infos_t::iterator it = crash_info.begin(); it!=crash_info.end(); ++it) {
retval.push_back(it->GetMap());
}
@@ -237,9 +253,9 @@ void CCrashWatcher::StartWatch()
/* daemon loop with glib */
void CCrashWatcher::GStartWatch()
{
- g_io_add_watch (m_nGio, G_IO_IN, handle_event_cb, this);
+ g_io_add_watch (m_pGio, G_IO_IN, handle_event_cb, this);
//enter the event loop
- g_main_run (m_nMainloop);
+ g_main_run (m_pMainloop);
}
diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h
index dfe716f..b1d0d39 100644
--- a/src/Daemon/CrashWatcher.h
+++ b/src/Daemon/CrashWatcher.h
@@ -44,8 +44,8 @@ class CCrashWatcher
void Lock();
int m_nFd;
- GIOChannel* m_nGio;
- GMainLoop *m_nMainloop;
+ GIOChannel* m_pGio;
+ GMainLoop *m_pMainloop;
std::string m_sTarget;
CMiddleWare *m_pMW;
DBus::Connection *m_pConn;
diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am
index 8a88fbc..d36828b 100644
--- a/src/Daemon/Makefile.am
+++ b/src/Daemon/Makefile.am
@@ -1,13 +1,13 @@
-sbin_PROGRAMS = crash-catcher
-crash_catcher_SOURCES = CrashWatcher.cpp CrashWatcher.h Daemon.cpp DBusServerProxy.h \
+sbin_PROGRAMS = abrt
+abrt_SOURCES = CrashWatcher.cpp CrashWatcher.h Daemon.cpp DBusServerProxy.h \
DBusCommon.h
-crash_catcher_CPPFLAGS = -Wall -Werror -I../../lib/MiddleWare\
+abrt_CPPFLAGS = -Wall -Werror -I../../lib/MiddleWare\
-I../../lib/DBus \
-DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" $(DBUS_GLIB_CFLAGS) $(DBUSCPP_CFLAGS) \
-DPLUGINS_LIB_DIR=\"$(PLUGINS_LIB_DIR)\" \
-DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \
-DCONF_DIR=\"$(CONF_DIR)\"
-crash_catcher_LDADD = ../../lib/MiddleWare/libMiddleWare.la $(DL_LIBS) $(DBUSCPP_LIBS) $(RPM_LIBS)
+abrt_LDADD = ../../lib/MiddleWare/libMiddleWare.la $(DL_LIBS) $(DBUSCPP_LIBS) $(RPM_LIBS)
-dbuscrashcatcherconfdir = ${sysconfdir}/dbus-1/system.d/
-dist_dbuscrashcatcherconf_DATA = dbus-crash-catcher.conf
+dbusabrtconfdir = ${sysconfdir}/dbus-1/system.d/
+dist_dbusabrtconf_DATA = dbus-abrt.conf
diff --git a/src/Daemon/dbus-crash-catcher.conf b/src/Daemon/dbus-abrt.conf
index 75c9a6d..75c9a6d 100644
--- a/src/Daemon/dbus-crash-catcher.conf
+++ b/src/Daemon/dbus-abrt.conf