summaryrefslogtreecommitdiffstats
path: root/src/Daemon/CrashWatcher.cpp
diff options
context:
space:
mode:
authorJiri Moskovcak <jmoskovc@redhat.com>2009-02-16 13:24:29 +0100
committerJiri Moskovcak <jmoskovc@redhat.com>2009-02-16 13:24:29 +0100
commit5c22d0c110b8678509817abf9ecf10e3f48525d5 (patch)
tree75c82fb52b21b2ac020b5f24f3c046a9e087a38b /src/Daemon/CrashWatcher.cpp
parentbccd32e8a752294bd11d930e2311ac4c64cfc43c (diff)
downloadabrt-5c22d0c110b8678509817abf9ecf10e3f48525d5.tar.gz
abrt-5c22d0c110b8678509817abf9ecf10e3f48525d5.tar.xz
abrt-5c22d0c110b8678509817abf9ecf10e3f48525d5.zip
Rewritten the lock file ignore hack
Diffstat (limited to 'src/Daemon/CrashWatcher.cpp')
-rw-r--r--src/Daemon/CrashWatcher.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp
index ede9594..a6eb487 100644
--- a/src/Daemon/CrashWatcher.cpp
+++ b/src/Daemon/CrashWatcher.cpp
@@ -43,7 +43,7 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition,
g_warning ("Error reading inotify fd: %d\n", err);
return FALSE;
}
- /* reconstruct each event and send to the user's callback */
+ /* reconstruct each event and send message to the dbus */
while (i < len) {
const char *name;
struct inotify_event *event;
@@ -56,21 +56,24 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition,
std::cout << "Created file: " << name << std::endl;
#endif /*DEBUG*/
-//HACK!!!
- std::string sName = name;
- if (sName.find(".lock") != std::string::npos)
+ /* we want to ignore the lock files */
+ if(event->mask & IN_ISDIR)
{
- return TRUE;
+ std::string sName = name;
+ CCrashWatcher *cc = (CCrashWatcher*)daemon;
+ CMiddleWare::crash_info_t crashinfo;
+ if(cc->m_pMW->SaveDebugDump(std::string(DEBUG_DUMPS_DIR) + "/" + name, crashinfo))
+ {
+ /* send message to dbus */
+ cc->m_pDbusServer->Crash(crashinfo.m_sPackage);
+ }
}
- std::cout << "kuk" << std::endl;
- CCrashWatcher *cc = (CCrashWatcher*)daemon;
- CMiddleWare::crash_info_t crashinfo;
- if(cc->m_pMW->SaveDebugDump(std::string(DEBUG_DUMPS_DIR) + "/" + name, crashinfo))
+#ifdef DEBUG
+ else
{
- /* send message to dbus */
- cc->m_pDbusServer->Crash(crashinfo.m_sPackage);
+ std::cerr << "Some file created, ignoring.." << std::endl;
}
- std::cout << "kuk2" << std::endl;
+#endif /*DEBUG*/
}
return TRUE;
}