On Friday, November 19, 2010 12:45:47 pm Denys Vlasenko wrote:
This patch removes sqlite database.
Database was used to find dump dirs by [UID:]UUID.
This patch uses more natural way: dump dirs are addressed by their
directory names.
DB was also used to produce a list of dump dirs.
Now it is done by iterating over the /var/spool/abrt directory.
And finally, DB was also used to find duplicate UUIDs.
Now it is done by iterating over the /var/spool/abrt directory.
Crash count, "inform all" and reporting result message are moved
from DB field to a file in dump dir.
"Reported" DB field is deleted -
if message != "", then this dump was reported.
Patch is run-tested.
+ try
+ {
+ struct dirent *dent;
+ while ((dent = readdir(dir)) != NULL)
try..catch block can be removed. There is no longer function which throw
exception.
{
- case MW_OK:
- retval.push_back(info);
- break;
- case MW_ERROR:
- error_msg("Dump directory for crash_id %s doesn't exist
or misses crucial files, deleting", crash_id);
- /* Deletes both DB record and dump dir */
- DeleteDebugDump(crash_id, /*caller_uid:*/ 0);
- break;
- default:
- break;
+ if (dot_or_dotdot(dent->d_name))
+ continue; /* skip "." and ".." */
+
...
...
...
...
- }
- catch (CABRTException& e)
- {
- error_msg("%s", e.what());
+ catch (CABRTException& e)
+ {
+ error_msg("%s", e.what());
+ }
+ closedir(dir);
}
-----------------------------------
* report form. This form is used for later reporting.
* @param pDebugDumpDir A debugdump dir containing all necessary data.
^^^^^ should be dump_dir_name
* @param pCrashData A created crash report.
*/
-static bool DebugDumpToCrashReport(const char *pDebugDumpDir,
map_crash_data_t& pCrashData)
+static bool DebugDumpToCrashReport(const char *dump_dir_name,
map_crash_data_t& pCrashData)
I made a clean crash and just run:
$ abrt-cli -lf
! Can't open file
'/var/spool/abrt/ccpp-1290175121-19728/backtrace': No such
file or
directory
! Can't open file
'/var/spool/abrt/ccpp-1290175121-19728/backtrace': No such
file or
directory
Error accessing crash data: no ['message']
these messages are pretty anoying and crash is not listed
$ ls /var/spool/abrt/
ccpp-1290175121-19728 last-ccpp
--
Nikola