summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2011-05-17 17:02:19 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2011-05-17 17:02:19 +0200
commitb1a334bc10c89579e5ebefe966333e2718b787c5 (patch)
treeabfb99c45ea86c5b15772995fa6c08b694fed3fb /src/plugins
parent92cb090b4bb41ae18e662496f6863c609849db11 (diff)
downloadabrt-b1a334bc10c89579e5ebefe966333e2718b787c5.tar.gz
abrt-b1a334bc10c89579e5ebefe966333e2718b787c5.tar.xz
abrt-b1a334bc10c89579e5ebefe966333e2718b787c5.zip
abrt-action-bugzilla: store "reported_to" for new bugs too. closes bz#698406
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/abrt-action-bugzilla.c16
-rw-r--r--src/plugins/rhbz.c28
-rw-r--r--src/plugins/rhbz.h8
3 files changed, 24 insertions, 28 deletions
diff --git a/src/plugins/abrt-action-bugzilla.c b/src/plugins/abrt-action-bugzilla.c
index 98a47043..ee678fe8 100644
--- a/src/plugins/abrt-action-bugzilla.c
+++ b/src/plugins/abrt-action-bugzilla.c
@@ -188,7 +188,6 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings
}
xmlrpc_DECREF(all_bugs);
}
-
}
free(product);
@@ -203,19 +202,17 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings
rhbz_attachments(client, bug_id_str, problem_data, RHBZ_NOMAIL_NOTIFY);
- log(_("Logging out"));
- rhbz_logout(client);
-
- log("Status: NEW %s/show_bug.cgi?id=%u", bugzilla_url, bug_id);
- abrt_xmlrpc_free_client(client);
- return;
+ bz = new_bug_info();
+ bz->bi_status = xstrdup("NEW");
+ bz->bi_id = bug_id;
+ goto log_out;
}
// decision based on state
log(_("Bug is already reported: %i"), bz->bi_id);
if ((strcmp(bz->bi_status, "CLOSED") == 0)
- && (strcmp(bz->bi_resolution, "DUPLICATE") == 0))
- {
+ && (strcmp(bz->bi_resolution, "DUPLICATE") == 0)
+ ) {
struct bug_info *origin;
origin = rhbz_find_origin_bug_closed_duplicate(client, bz);
if (origin)
@@ -264,6 +261,7 @@ static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings
}
}
+ log_out:
log(_("Logging out"));
rhbz_logout(client);
diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c
index d7d583dd..83c3d20a 100644
--- a/src/plugins/rhbz.c
+++ b/src/plugins/rhbz.c
@@ -35,10 +35,10 @@ void free_bug_info(struct bug_info *bi)
if (!bi)
return;
- free((void*)bi->bi_status);
- free((void*)bi->bi_resolution);
- free((void*)bi->bi_reporter);
- free((void*)bi->bi_product);
+ free(bi->bi_status);
+ free(bi->bi_resolution);
+ free(bi->bi_reporter);
+ free(bi->bi_product);
list_free_with_free(bi->bi_cc_list);
@@ -174,18 +174,16 @@ void *rhbz_bug_read_item(const char *memb, xmlrpc_value *xml, int flags)
return (void*)string;
}
+ if (IS_READ_INT(flags))
{
- if (IS_READ_INT(flags))
- {
- int *integer = xmalloc(sizeof(int));
- xmlrpc_read_int(&env, member, integer);
- xmlrpc_DECREF(member);
- if (env.fault_occurred)
- abrt_xmlrpc_die(&env);
-
- VERB3 log("found %s: '%i'", memb, *integer);
- return (void*)integer;
- }
+ int *integer = xmalloc(sizeof(int));
+ xmlrpc_read_int(&env, member, integer);
+ xmlrpc_DECREF(member);
+ if (env.fault_occurred)
+ abrt_xmlrpc_die(&env);
+
+ VERB3 log("found %s: '%i'", memb, *integer);
+ return (void*)integer;
}
die:
free((void*)string);
diff --git a/src/plugins/rhbz.h b/src/plugins/rhbz.h
index f44ca191..60d64070 100644
--- a/src/plugins/rhbz.h
+++ b/src/plugins/rhbz.h
@@ -49,10 +49,10 @@ struct bug_info {
int bi_id;
int bi_dup_id;
- const char *bi_status;
- const char *bi_resolution;
- const char *bi_reporter;
- const char *bi_product;
+ char *bi_status;
+ char *bi_resolution;
+ char *bi_reporter;
+ char *bi_product;
GList *bi_cc_list;
};