diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-11 16:43:57 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-12-11 16:43:57 +0100 |
| commit | 890f62322fc8fee262e39a10428b1a2489edf267 (patch) | |
| tree | 1d4af471459ad12ffb3c3041b628df056f9cb15c /src/CLI/dbus.cpp | |
| parent | 4cd94cba0537d47078dac0c075b8ba55a7c53599 (diff) | |
| download | abrt-890f62322fc8fee262e39a10428b1a2489edf267.tar.gz abrt-890f62322fc8fee262e39a10428b1a2489edf267.tar.xz abrt-890f62322fc8fee262e39a10428b1a2489edf267.zip | |
abrt-cli: report success/failure of reporting. closes bug 71
See https://fedorahosted.org/abrt/ticket/71
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/CLI/dbus.cpp')
| -rw-r--r-- | src/CLI/dbus.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/CLI/dbus.cpp b/src/CLI/dbus.cpp index f25165b..b218679 100644 --- a/src/CLI/dbus.cpp +++ b/src/CLI/dbus.cpp @@ -142,7 +142,7 @@ map_crash_report_t call_CreateReport(const char* uuid) return argout; } -void call_Report(const map_crash_report_t& report) +report_status_t call_Report(const map_crash_report_t& report) { DBusMessage* msg = new_call_msg(__func__ + 5); DBusMessageIter out_iter; @@ -150,10 +150,17 @@ void call_Report(const map_crash_report_t& report) store_val(&out_iter, report); DBusMessage *reply = send_get_reply_and_unref(msg); - //it returns a single value of report_status_t type, - //but we don't use it (yet?) + + DBusMessageIter in_iter; + dbus_message_iter_init(reply, &in_iter); + + report_status_t result; + int r = load_val(&in_iter, result); + if (r != ABRT_DBUS_LAST_FIELD) /* more values present, or bad type */ + error_msg_and_die("dbus call %s: return type mismatch", __func__ + 5); dbus_message_unref(reply); + return result; } int32_t call_DeleteDebugDump(const char* uuid) |
