summaryrefslogtreecommitdiffstats
path: root/src/Daemon/Daemon.cpp
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-08-26 19:40:28 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-08-26 19:40:28 +0200
commitcaf38bbfe3279b9bea861e4d5b70f3c50c6e1755 (patch)
tree5ed7f83b0bdb584422f2e99489cfc81aac645500 /src/Daemon/Daemon.cpp
parentfca6fa371006186d12a720cd48c270789c67d2e6 (diff)
downloadabrt-caf38bbfe3279b9bea861e4d5b70f3c50c6e1755.tar.gz
abrt-caf38bbfe3279b9bea861e4d5b70f3c50c6e1755.tar.xz
abrt-caf38bbfe3279b9bea861e4d5b70f3c50c6e1755.zip
add job ids (== thread ids) to warning/update DBus messages
renamed: comm_layer_inner_warning -> warn_client comm_layer_inner_status -> update_client Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon/Daemon.cpp')
-rw-r--r--src/Daemon/Daemon.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp
index f5b40b4a..7821f0f1 100644
--- a/src/Daemon/Daemon.cpp
+++ b/src/Daemon/Daemon.cpp
@@ -274,36 +274,34 @@ static void SetUpCron()
static void FindNewDumps(const std::string& pPath)
{
log("Scanning for unsaved entries...");
- struct dirent *ep;
struct stat stats;
DIR *dp;
std::vector<std::string> dirs;
std::string dname;
// get potential unsaved debugdumps
dp = opendir(pPath.c_str());
- if (dp != NULL)
+ if (dp == NULL)
{
- while ((ep = readdir(dp)))
+ throw CABRTException(EXCEP_FATAL, "FindNewDumps(): Couldn't open the directory:" + pPath);
+ }
+ struct dirent *ep;
+ while ((ep = readdir(dp)))
+ {
+ if (dot_or_dotdot(ep->d_name))
+ continue;
+ dname = pPath + "/" + ep->d_name;
+ if (lstat(dname.c_str(), &stats) == 0)
{
- if (dot_or_dotdot(ep->d_name))
- continue;
- dname = pPath + "/" + ep->d_name;
- if (lstat(dname.c_str(), &stats) == 0)
+ if (S_ISDIR(stats.st_mode))
{
- if (S_ISDIR(stats.st_mode))
- {
- dirs.push_back(dname);
- }
+ dirs.push_back(dname);
}
}
- (void) closedir(dp);
- }
- else
- {
- throw CABRTException(EXCEP_FATAL, "FindNewDumps(): Couldn't open the directory:" + pPath);
}
+ closedir(dp);
- for (std::vector<std::string>::iterator itt = dirs.begin(); itt != dirs.end(); ++itt){
+ for (std::vector<std::string>::iterator itt = dirs.begin(); itt != dirs.end(); ++itt)
+ {
map_crash_info_t crashinfo;
try
{
@@ -572,7 +570,7 @@ int main(int argc, char** argv)
{
pthread_mutex_init(&g_pJobsMutex, NULL); /* never fails */
/* DBus init - we want it early so that errors are reported */
- comm_layer_inner_init(&watcher);
+ init_daemon_logging(&watcher);
/* Watching DEBUG_DUMPS_DIR for new files... */
errno = 0;
int inotify_fd = inotify_init();