ret = TRUE;
}
+ g_variant_iter_free(iter);
+
_I("Success. (%s): %d", METHOD_BLOCK_GETDEVICELIST, ret);
return ret;
}
g_variant_new("(s)", type));
if (!msg) {
- _E("Failed to call dbus method(%s): no reply", METHOD_BLOCK_GETMMCPRIMARY);
+ _E("Failed to call dbus method(%s)", METHOD_BLOCK_GETMMCPRIMARY);
return ret;
}
ret = TRUE;
}
+ g_variant_iter_free(iter);
+
_I("Success. %s: %d", METHOD_BLOCK_GETDEVICELIST2, ret);
return ret;
}
enum block_device_type block_type;
int i;
GVariantBuilder *builder = NULL;
+ const char *error = NULL;
g_variant_get(param, "(s)", &type);
- if (!type) {
- _E("Delivered type is NULL.");
- goto out;
- }
-
_D("Block (%s) device list is requested.", type);
block_type = get_bdev_type_from_type_string(type);
if (block_type == BLOCK_UNKNOWN_DEV) {
_E("Invalid type (%s) is requested.", type);
+ error = "Invalid type is requested";
goto out;
}
}
pthread_mutex_unlock(&(th_manager[i].mutex));
}
+
reply = g_variant_new("(a(issssssisibii))", builder);
+
g_variant_builder_unref(builder);
out:
g_free(type);
+
if (!reply)
- reply = dbus_handle_new_g_variant_tuple();
+ g_dbus_method_invocation_return_error(invocation,
+ G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+ "%s", error);
return reply;
}
enum block_device_type block_type;
int i;
GVariantBuilder *builder = NULL;
+ const char *error = NULL;
g_variant_get(param, "(s)", &type);
if (!type) {
_E("Delivered type is NULL.");
+ error = "Delivered type is NULL";
goto out;
}
block_type = get_bdev_type_from_type_string(type);
if (block_type == BLOCK_UNKNOWN_DEV) {
_E("Invalid type (%s) is requested.", type);
+ error = "Invalid type is requested";
goto out;
}
}
pthread_mutex_unlock(&(th_manager[i].mutex));
}
+
reply = g_variant_new("(a(issssssisibi))", builder);
+
g_variant_builder_unref(builder);
out:
g_free(type);
+
+ if (!reply)
+ g_dbus_method_invocation_return_error(invocation,
+ G_DBUS_ERROR, G_DBUS_ERROR_FAILED,
+ "%s", error);
return reply;
}