diff options
| author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-10-06 12:42:13 +0200 |
|---|---|---|
| committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-10-06 12:42:13 +0200 |
| commit | 350eacf7f1948d52d6c71789845b0b640bb048ac (patch) | |
| tree | d4b296a0b348b4d5a2ec878de91a3432708c34d3 /src/hooks/dumpoops.cpp | |
| parent | 4fb70fe4df4e54f8da1a8c356fa7724180c96181 (diff) | |
| parent | 2a43414497aa857d9dbf3e2dc04ac207d5730335 (diff) | |
| download | abrt-350eacf7f1948d52d6c71789845b0b640bb048ac.tar.gz abrt-350eacf7f1948d52d6c71789845b0b640bb048ac.tar.xz abrt-350eacf7f1948d52d6c71789845b0b640bb048ac.zip | |
Merge branch 'vector_string_t'
* vector_string_t:
report.cpp: split() uses GList
Kerneloops*.cpp and dumpoops.cpp uses GList
Daemon.cpp: FindNewDumps() uses GList
Diffstat (limited to 'src/hooks/dumpoops.cpp')
| -rw-r--r-- | src/hooks/dumpoops.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/hooks/dumpoops.cpp b/src/hooks/dumpoops.cpp index 547ece9d..c67f8cda 100644 --- a/src/hooks/dumpoops.cpp +++ b/src/hooks/dumpoops.cpp @@ -25,6 +25,7 @@ #include "abrt_exception.h" #include "KerneloopsScanner.h" #include <dlfcn.h> +#include <glib.h> #define LOADSYM(fp, name) \ do { \ @@ -75,8 +76,8 @@ usage: /* Load KerneloopsScanner plugin */ // const plugin_info_t *plugin_info; CPlugin* (*plugin_newf)(void); - int (*scan_syslog_file)(vector_string_t& oopsList, const char *filename, time_t *last_changed_p); - int (*save_oops_to_debug_dump)(const vector_string_t& oopsList); + int (*scan_syslog_file)(GList **oopsList, const char *filename, time_t *last_changed_p); + int (*save_oops_to_debug_dump)(GList **oopsList); void *handle; errno = 0; @@ -95,21 +96,22 @@ usage: // scanner->LoadSettings(path); /* Use it: parse and dump the oops */ - vector_string_t oopsList; - int cnt = scan_syslog_file(oopsList, argv[0], NULL); + GList *oopsList = NULL; + int cnt = scan_syslog_file(&oopsList, argv[0], NULL); log("found oopses: %d", cnt); if (cnt > 0) { if (opt_s) { int i = 0; - while (i < oopsList.size()) { - printf("\nVersion: %s", oopsList[i].c_str()); + int length = g_list_length(oopsList); + while (i < length) { + printf("\nVersion: %s", (char*)g_list_nth_data(oopsList, i)); i++; } } if (opt_d) { log("dumping oopses"); - int errors = save_oops_to_debug_dump(oopsList); + int errors = save_oops_to_debug_dump(&oopsList); if (errors > 0) { log("%d errors while dumping oopses", errors); @@ -118,6 +120,12 @@ usage: } } - /*dlclose(handle); - why bother? */ + for (GList *li = oopsList; li != NULL; li = g_list_next(li)) + free((char*)li->data); + + g_list_free(oopsList); + /*dlclose(handle); - why bother? + * cos we are handsome and good lookin' guys :D + */ return 0; } |
