static void storage_config_load(struct storage_config_info *info)
{
- int ret;
+ int ret_val;
- ret = config_parse(STORAGE_CONF_FILE, load_config, info);
- if (ret < 0)
- _E("Failed to load %s, %d Use default value!", STORAGE_CONF_FILE, ret); //LCOV_EXCL_LINE
+ ret_val = config_parse(STORAGE_CONF_FILE, load_config, info);
+ if (ret_val < 0)
+ _E("Failed to load %s, %d Use default value!", STORAGE_CONF_FILE, ret_val); //LCOV_EXCL_LINE
}
static int get_memory_size(const char *path, struct statvfs_32 *buf)
{
struct statvfs s;
- int ret;
+ int ret_val;
assert(buf);
- ret = statvfs(path, &s);
- if (ret)
+ ret_val = statvfs(path, &s);
+ if (ret_val)
return -errno; //LCOV_EXCL_LINE System Error
memset(buf, 0, sizeof(struct statvfs_32));
{
struct statvfs_32 temp;
static unsigned long reserved = 0;
- int ret;
+ int ret_val;
if (!buf) {
_E("input param error");
return STORAGE_ERROR_INVALID_PARAMETER;
}
- ret = get_memory_size(tzplatform_getenv(TZ_SYS_USER), &temp);
- if (ret || temp.f_bsize == 0) {
- _E("fail to get memory size %d", ret); //LCOV_EXCL_LINE
+ ret_val = get_memory_size(tzplatform_getenv(TZ_SYS_USER), &temp);
+ if (ret_val || temp.f_bsize == 0) {
+ _E("fail to get memory size %d", ret_val); //LCOV_EXCL_LINE
return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
API int storage_get_internal_memory_size64(struct statvfs *buf)
{
static unsigned long reserved = 0;
- int ret;
+ int ret_val;
if (!buf) {
_E("input param error"); //LCOV_EXCL_LINE
return STORAGE_ERROR_INVALID_PARAMETER;
}
- ret = statvfs(tzplatform_getenv(TZ_SYS_USER), buf);
- if (ret) {
+ ret_val = statvfs(tzplatform_getenv(TZ_SYS_USER), buf);
+ if (ret_val) {
_E("fail to get memory size"); //LCOV_EXCL_LINE
return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
int storage_get_external_memory_size_with_path(char *path, struct statvfs *buf)
{
struct statvfs_32 temp;
- int ret;
+ int ret_val;
char ext_path[32];
_D("storage_get_external_memory_size");
_D("Block module is not enabled");
return STORAGE_ERROR_NOT_SUPPORTED;
}
- ret = get_external_path(ext_path, sizeof(ext_path));
- if (ret == -ENODEV)
+ ret_val = get_external_path(ext_path, sizeof(ext_path));
+ if (ret_val == -ENODEV)
goto out_nodev;
- if (ret < 0) {
- _E("Failed to get external path(%d)", ret); //LCOV_EXCL_LINE
+ if (ret_val < 0) {
+ _E("Failed to get external path(%d)", ret_val); //LCOV_EXCL_LINE
return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
}
if (!mount_check((const char *)ext_path))
goto out_nodev;
- ret = storage_ext_get_statvfs(ext_path, &temp);
- if (ret != 0) {
+ ret_val = storage_ext_get_statvfs(ext_path, &temp);
+ if (ret_val != 0) {
_E("fail to get memory size"); //LCOV_EXCL_LINE
return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
/* This api is intended for binaries built with __USE_FILE_OFFSET64(_FILE_OFFSET_BITS=64) */
int storage_get_external_memory_size64_with_path(char *path, struct statvfs *buf)
{
- int ret;
+ int ret_val;
char ext_path[32];
_D("storage_get_external_memory_size64");
_D("Block module is not enabled");
return STORAGE_ERROR_NOT_SUPPORTED;
}
- ret = get_external_path(ext_path, sizeof(ext_path));
- if (ret == -ENODEV)
+ ret_val = get_external_path(ext_path, sizeof(ext_path));
+ if (ret_val == -ENODEV)
goto out_nodev;
- if (ret < 0) {
- _E("Failed to get external path(%d)", ret);
+ if (ret_val < 0) {
+ _E("Failed to get external path(%d)", ret_val);
return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE
}
}
if (!mount_check((const char *)ext_path))
goto out_nodev;
- ret = storage_ext_get_statvfs_size64(ext_path, buf);
- if (ret != 0) {
+ ret_val = storage_ext_get_statvfs_size64(ext_path, buf);
+ if (ret_val != 0) {
//LCOV_EXCL_START System Error
_E("fail to get memory size");
return STORAGE_ERROR_OPERATION_FAILED; //LCOV_EXCL_LINE