DBusMessage *message_send;
DBusMessageIter iter;
struct tech_data technology;
+ DBusError err;
match_tech_name(message, tech, &technology);
if (g_strcmp0(tech, technology.name) != 0) {
- fprintf(stderr, "%s does not exist on the system\n", tech);
- fprintf(stderr, "Use the 'tech' command to find available "
- "technologies on your system.\n");
return -ENXIO;
}
dbus_message_iter_init_append(message_send, &iter);
dbus_property_append_basic(&iter, (const char *) key,
DBUS_TYPE_BOOLEAN, &value);
- dbus_connection_send(connection, message_send, NULL);
- dbus_connection_flush(connection);
- dbus_message_unref(message_send);
+
+ dbus_error_init(&err);
+ dbus_connection_send_with_reply_and_block(connection, message_send,
+ -1, &err);
+ if (dbus_error_is_set(&err) == TRUE) {
+ printf("Error '%s' %s\n", technology.path, err.message);
+ dbus_error_free(&err);
+ }
+
g_free(technology.name);
g_free(technology.path);