ret = storage_ext_get_device_info(storage_id, dev);
if (ret < 0) {
_E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret); //LCOV_EXCL_LINE
- goto out;
+ goto out; //LCOV_EXCL_LINE
}
ret = storage_ext_get_dev_state(dev, STORAGE_EXT_CHANGED, &state);
if (ret < 0) {
_E("Failed to get state of storage (id:%d, ret:%d)", storage_id, ret); //LCOV_EXCL_LINE
- goto out;
+ goto out; //LCOV_EXCL_LINE
}
if (state >= STORAGE_STATE_MOUNTED) {
#endif
if (ret < 0) {
_E("Failed to get external memory size of (%s)(ret:%d)", dev->mount_point, ret); //LCOV_EXCL_LINE
- goto out;
+ goto out; //LCOV_EXCL_LINE
}
t = (unsigned long long)s.f_frsize*s.f_blocks;
int storage_ext_foreach_device_list(storage_device_supported_cb callback, void *user_data)
{
- int ret;
+ int ret_val;
bool ret_cb;
GList *list = NULL, *elem;
storage_ext_device *dev;
if (!callback)
return -EINVAL;
- ret = storage_ext_get_list(&list);
- if (ret < 0) {
+ ret_val = storage_ext_get_list(&list);
+ if (ret_val < 0) {
_E("Failed to get external storage list from deviced (%d)", errno); //LCOV_EXCL_LINE
- return ret;
+ return ret_val; //LCOV_EXCL_LINE
}
SYS_G_LIST_FOREACH(list, elem, dev) {
- ret = storage_ext_get_dev_state(dev, STORAGE_EXT_CHANGED, &state);
- if (ret < 0) {
- _E("Failed to get storage state (devnode:%s, ret:%d)", dev->devnode, ret); //LCOV_EXCL_LINE
- continue;
+ ret_val = storage_ext_get_dev_state(dev, STORAGE_EXT_CHANGED, &state);
+ if (ret_val < 0) {
+ _E("Failed to get storage state (devnode:%s, ret_val:%d)", dev->devnode, ret_val); //LCOV_EXCL_LINE
+ continue; //LCOV_EXCL_LINE
}
if (dev->type == STORAGE_EXT_MMC_EXTENDED_INTERNAL)
struct storage_cb_info *cb_info;
GList *elem;
storage_state_e state;
- int ret;
+ int ret_val;
storage_dev_e strdev;
storage_type_e storage_type;
const char *fstype, *fsuuid, *mountpath;
if (type != STORAGE_CALLBACK_TYPE)
return -EINVAL;
- ret = storage_ext_get_dev_state(dev, blk_state, &state);
- if (ret < 0) {
- _E("Failed to get storage state (devnode:%s, ret:%d)", dev->devnode, ret);
- return ret;
+ ret_val = storage_ext_get_dev_state(dev, blk_state, &state);
+ if (ret_val < 0) {
+ _E("Failed to get storage state (devnode:%s, ret_val:%d)", dev->devnode, ret_val);
+ return ret_val;
}
if (dev->type == STORAGE_EXT_SCSI) {
int storage_ext_register_cb(enum storage_cb_type type, struct storage_cb_info *info)
{
struct storage_cb_info *cb_info;
- int n, ret;
+ int n, ret_val;
storage_ext_changed_cb callback;
if (!info)
n = SYS_G_LIST_LENGTH(cb_list[type]);
if (n == 0) {
- ret = storage_ext_register_device_change(callback, (void *)type);
- if (ret < 0)
+ ret_val = storage_ext_register_device_change(callback, (void *)type);
+ if (ret_val < 0)
return -EPERM;
}
/* add device changed callback to list (local) */
cb_info = malloc(sizeof(struct storage_cb_info));
if (!cb_info)
- return -errno;
+ return -errno; //LCOV_EXCL_LINE
memcpy(cb_info, info, sizeof(struct storage_cb_info));
SYS_G_LIST_APPEND(cb_list[type], cb_info);
}
if (!check_if_callback_exist(type, info, &cb_info)) {
+ //LCOV_EXCL_START Callbacked is not registered case
_E("The callback is not registered");
return 0;
+ //LCOV_EXCL_STOP
}
/* remove device callback from list (local) */
if (access(file_name, R_OK) == 0) {
fp = fopen(file_name, "r");
if (!fp) {
- _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret); //LCOV_EXCL_LINE
+ //LCOV_EXCL_START File operation error
+ _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret);
ret = -ENODEV;
goto out;
+ //LCOV_EXCL_STOP
}
tmp = fgets(path, len, fp);
fclose(fp);
if (!tmp) {
+ //LCOV_EXCL_START File operation error
ret = -ENODEV;
_D("Failed to get path");
goto out;
+ //LCOV_EXCL_STOP
}
*extendedinternal = false;
} else if (access(file_name2, R_OK) == 0) {
fp = fopen(file_name2, "r");
if (!fp) {
- _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret); //LCOV_EXCL_LINE
+ //LCOV_EXCL_START File operation error
+ _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret);
ret = -ENODEV;
goto out;
+ //LCOV_EXCL_STOP
}
tmp = fgets(path, len, fp);
fclose(fp);
if (!tmp) {
+ //LCOV_EXCL_START File operation error
ret = -ENODEV;
_D("Failed to get path");
goto out;
+ //LCOV_EXCL_STOP
}
*extendedinternal = true;
} else {
ret = storage_ext_get_device_info(storage_id, dev);
if (ret < 0) {
- _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret); //LCOV_EXCL_LINE
+ //LCOV_EXCL_START
+ _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret);
storage_ext_release_device(&dev);
goto out;
+ //LCOV_EXCL_STOP
}
snprintf(path, len, "%s", dev->mount_point);
ret = storage_ext_get_device_info(storage_id, dev);
if (ret < 0) {
- _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret); //LCOV_EXCL_LINE
+ //LCOV_EXCL_START
+ _E("Cannot get the storage with id (%d, ret:%d)", storage_id, ret);
goto out;
+ //LCOV_EXCL_STOP
}
ret = storage_ext_get_dev_state(dev, STORAGE_EXT_CHANGED, state);
ret = storage_ext_get_list(&list);
if (ret < 0) {
- _E("Failed to get external storage list from deviced (%d)", errno); //LCOV_EXCL_LINE
+ //LCOV_EXCL_START
+ _E("Failed to get external storage list from deviced (%d)", errno);
return ret;
+ //LCOV_EXCL_STOP
}
SYS_G_LIST_FOREACH(list, elem, dev) {