out:
if (ret < 0)
- storage_ext_release_list(list);
+ storage_ext_release_list(list); //LCOV_EXCL_LINE System Error
g_variant_iter_free(iter);
g_variant_unref(result);
return ret;
callback = (struct storage_ext_callback *)malloc(sizeof(struct storage_ext_callback));
if (!callback) {
-//LCOV_EXCL_START System Error
+ //LCOV_EXCL_START System Error
_E("malloc() failed");
return -ENOMEM;
-//LCOV_EXCL_STOP
+ //LCOV_EXCL_STOP
}
conn = get_dbus_connection();
if (!conn) {
-//LCOV_EXCL_START System Error
+ //LCOV_EXCL_START System Error
free(callback);
_E("Failed to get dbus connection");
return -EPERM;
-//LCOV_EXCL_STOP
+ //LCOV_EXCL_STOP
}
block_id = g_dbus_connection_signal_subscribe(conn,
NULL,
NULL);
if (block_id == 0) {
+ //LCOV_EXCL_START System Error
free(callback);
_E("Failed to subscrive bus signal");
return -EPERM;
+ //LCOV_EXCL_STOP
}
callback->func = func;
GDBusConnection *conn;
struct storage_ext_callback *callback;
dd_list *elem;
+ dd_list *elem_n;
if (!func)
return;
//LCOV_EXCL_STOP
}
- DD_LIST_FOREACH(changed_list, elem, callback) {
+ DD_LIST_FOREACH_SAFE(changed_list, elem, elem_n, callback) {
if (callback->func != func)
continue;
if (callback->block_id > 0)
return -ENODEV;
}
- g_variant_get(result, "(issssssisibii)",
- &info->type, &info->devnode, &info->syspath,
- &info->fs_usage, &info->fs_type,
- &info->fs_version, &info->fs_uuid,
- &info->readonly, &info->mount_point,
- &info->state, &info->primary,
- &info->flags, &info->storage_id);
+ if (g_variant_check_format_string(result, "(issssssisibii)", true)) {
+ g_variant_get(result, "(issssssisibii)",
+ &info->type, &info->devnode, &info->syspath,
+ &info->fs_usage, &info->fs_type,
+ &info->fs_version, &info->fs_uuid,
+ &info->readonly, &info->mount_point,
+ &info->state, &info->primary,
+ &info->flags, &info->storage_id);
+ } else {
+ _E("No storage with the storage id (%d)", storage_id); //LCOV_EXCL_LINE
+ return -ENODEV;
+ }
g_variant_unref(result);