summaryrefslogtreecommitdiffstats
path: root/src/hooks
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2010-09-30 18:56:38 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2010-10-06 11:22:14 +0200
commit43c4ec48451330d8290d28c6ad1d2793ac3207fa (patch)
tree7085ab00b6e46bf4f396efc5366e22e5dd5e5a6c /src/hooks
parent888577a1086f07f74692ca58d8a46a413a59ec2f (diff)
downloadabrt-43c4ec48451330d8290d28c6ad1d2793ac3207fa.tar.gz
abrt-43c4ec48451330d8290d28c6ad1d2793ac3207fa.tar.xz
abrt-43c4ec48451330d8290d28c6ad1d2793ac3207fa.zip
Kerneloops*.cpp and dumpoops.cpp uses GList
vector_string_t was replaced by glist in these files Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/hooks')
-rw-r--r--src/hooks/Makefile.am4
-rw-r--r--src/hooks/dumpoops.cpp24
2 files changed, 19 insertions, 9 deletions
diff --git a/src/hooks/Makefile.am b/src/hooks/Makefile.am
index 55ffc446..4d7c342a 100644
--- a/src/hooks/Makefile.am
+++ b/src/hooks/Makefile.am
@@ -24,11 +24,13 @@ dumpoops_CPPFLAGS = \
-DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \
-DCONF_DIR=\"$(CONF_DIR)\" \
-DVAR_RUN=\"$(VAR_RUN)\" \
+ $(GLIB_CFLAGS) \
-D_GNU_SOURCE
# build will succeed, but at runtime plugins do need ABRT*d*Utils
dumpoops_LDADD = \
../../lib/utils/libABRTUtils.la \
- ../../lib/utils/libABRTdUtils.la
+ ../../lib/utils/libABRTdUtils.la \
+ $(GLIB_FLAGS)
python_PYTHON = abrt.pth abrt_exception_handler.py
EXTRA_DIST = abrt_exception_handler.py.in $(man_MANS)
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;
}