diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-09-30 14:24:01 +0200 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-10-06 11:10:17 +0200 |
commit | 888577a1086f07f74692ca58d8a46a413a59ec2f (patch) | |
tree | 83f2eef5d90286298c8db3cfc5befd5e0d84ce2c | |
parent | d7fb55008e2c676a0001d94b7ede730ae8c4f2f6 (diff) | |
download | abrt-888577a1086f07f74692ca58d8a46a413a59ec2f.tar.gz abrt-888577a1086f07f74692ca58d8a46a413a59ec2f.tar.xz abrt-888577a1086f07f74692ca58d8a46a413a59ec2f.zip |
Daemon.cpp: FindNewDumps() uses GList
transform vector_string_t to GList
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
-rw-r--r-- | src/daemon/Daemon.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp index 7f36b318..548067bd 100644 --- a/src/daemon/Daemon.cpp +++ b/src/daemon/Daemon.cpp @@ -391,7 +391,7 @@ static int SetUpCron() static void FindNewDumps(const char* pPath) { /* Get all debugdump directories in the pPath directory */ - vector_string_t dirs; + GList *dirs = NULL; DIR *dp = opendir(pPath); if (dp == NULL) { @@ -410,25 +410,25 @@ static void FindNewDumps(const char* pPath) if (S_ISDIR(stats.st_mode)) { VERB1 log("Will check directory '%s'", ep->d_name); - dirs.push_back(dname); + dirs = g_list_append(dirs, dname); + continue; } } free(dname); } closedir(dp); - unsigned size = dirs.size(); + unsigned size = g_list_length(dirs); if (size == 0) return; log("Checking for unsaved crashes (dirs to check:%u)", size); /* Get potentially non-processed debugdumps */ - vector_string_t::iterator itt = dirs.begin(); - for (; itt != dirs.end(); ++itt) + for (GList *li = dirs; li != NULL; li = g_list_next(li)) { try { - const char *dir_name = itt->c_str(); + const char *dir_name = (char*)dirs->data; map_crash_data_t crashinfo; mw_result_t res = SaveDebugDump(dir_name, crashinfo); switch (res) @@ -461,6 +461,12 @@ static void FindNewDumps(const char* pPath) error_msg("%s", e.what()); } } + + for (GList *li = dirs; li != NULL; li = g_list_next(li)) + free(li->data); + + g_list_free(dirs); + log("Done checking for unsaved crashes"); } |