ret = statvfs(path, &s);
if (ret)
- return -errno;
+ return -errno; //LCOV_EXCL_LINE System Error
memset(buf, 0, sizeof(struct statvfs_32));
ret = get_memory_size(tzplatform_getenv(TZ_SYS_HOME), &temp);
if (ret || temp.f_bsize == 0) {
_E("fail to get memory size"); //LCOV_EXCL_LINE
- return -errno;
+ return -errno; //LCOV_EXCL_LINE System Error
}
if (reserved == 0) {
ret = statvfs(tzplatform_getenv(TZ_SYS_HOME), buf);
if (ret) {
_E("fail to get memory size"); //LCOV_EXCL_LINE
- return -errno;
+ return -errno; //LCOV_EXCL_LINE System Error
}
if (reserved == 0) {
ret = get_memory_size(ext_path, &temp);
if (ret) {
_E("fail to get memory size"); //LCOV_EXCL_LINE
- return -errno;
+ return -errno; //LCOV_EXCL_LINE System Error
}
memcpy(buf, &temp, sizeof(temp));
ret = statvfs(ext_path, buf);
if (ret) {
+ //LCOV_EXCL_START System Error
_E("fail to get memory size");
return -errno;
+ //LCOV_EXCL_STOP
}
return 0;
r = mnt_table_parse_mtab(t, NULL);
if (r < 0) {
+ //LCOV_EXCL_START System Error
mnt_free_table(t);
return 0;
+ //LCOV_EXCL_STOP
}
fs = mnt_table_find_target(t, COMPAT_DIR, MNT_ITER_BACKWARD);
return 1;
}
+ //LCOV_EXCL_START System Error
mnt_free_table(t);
return 0;
+ //LCOV_EXCL_STOP
}
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;
// this API works on place where compat path is bind-mounted
if (!is_compat_bind_mount()) {
+ //LCOV_EXCL_START System Error
_E("No compat bind mount");
return -1;
+ //LCOV_EXCL_STOP
}
str = tzplatform_getenv(TZ_USER_CONTENT);
r = snprintf(compat, len, "%s%s", COMPAT_DIR, origin + str_len);
if (r < 0) {
+ //LCOV_EXCL_START System Error
_E("Failed to create new path");
return -1;
+ //LCOV_EXCL_STOP
}
return 0;
// this API works on place where compat path is bind-mounted
if (!is_compat_bind_mount()) {
+ //LCOV_EXCL_START System Error
_E("no compat bind mount");
return -1;
+ //LCOV_EXCL_STOP
}
compat_len = strlen(COMPAT_DIR);
r = snprintf(origin, len, "%s%s", tzplatform_getenv(TZ_USER_CONTENT), compat + compat_len);
if (r < 0) {
+ //LCOV_EXCL_START System Error
_E("failed to create new path");
return -1;
+ //LCOV_EXCL_STOP
}
return 0;
"GetMmcPrimary",
NULL);
if (!result) {
+ //LCOV_EXCL_START System Error
_E("Failed to get primary sdcard partition"); //LCOV_EXCL_LINE
return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
+ //LCOV_EXCL_STOP
}
g_variant_get(result, "(issssssisibii)",
*path = strdup(info.mount_point);
if (*path == NULL)
- return STORAGE_ERROR_OUT_OF_MEMORY;
+ return STORAGE_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE System Error
*storage_id = info.storage_id;
ext_dev = calloc(1, sizeof(storage_ext_device));
if (!ext_dev) {
-//LCOV_EXCL_START System Error
+ //LCOV_EXCL_START System Error
_E("calloc failed");
return STORAGE_ERROR_OUT_OF_MEMORY;
-//LCOV_EXCL_STOP
+ //LCOV_EXCL_STOP
}
ret = storage_ext_get_device_info(storage_id, ext_dev);
*path = strdup(root);
if (!*path) {
- _E("Failed to copy the root string : %d", errno);
+ _E("Failed to copy the root string : %d", errno); //LCOV_EXCL_LINE System Error
return STORAGE_ERROR_OUT_OF_MEMORY;
}
return STORAGE_ERROR_NONE;
}
+//LCOV_EXCL_START Not called Callback
static void compat_cb(int storage_id,
storage_dev_e dev, storage_state_e state,
const char *fstype, const char *fsuuid, const char *mountpath,
DD_LIST_FOREACH(compat_cb_list, elem, ccb_info)
ccb_info->user_cb(storage_id, state, ccb_info->user_data);
}
+//LCOV_EXCL_STOP
API int storage_set_state_changed_cb(int storage_id, storage_state_changed_cb callback, void *user_data)
{