GFile *noti_dir = NULL;
GError *g_err = NULL;
- if (access(dir, R_OK) != 0) {
- noti_dir = g_file_new_for_path(dir);
- if (g_file_make_directory(noti_dir, NULL, &g_err) == false) {
- /* LCOV_EXCL_START */
- if (g_err) {
- ERR("Failed to make sharing dir[%s]",
- g_err->message);
- g_error_free(g_err);
- }
- g_object_unref(noti_dir);
- return false;
- /* LCOV_EXCL_STOP */
+ if (access(dir, R_OK) == 0)
+ return true;
+
+ noti_dir = g_file_new_for_path(dir);
+ if (noti_dir == NULL)
+ return false;
+
+ if (g_file_make_directory(noti_dir, NULL, &g_err) == false) {
+ /* LCOV_EXCL_START */
+ if (g_err) {
+ ERR("Failed to make sharing dir[%s]", g_err->message);
+ g_error_free(g_err);
}
g_object_unref(noti_dir);
+ return false;
+ /* LCOV_EXCL_STOP */
}
+ g_object_unref(noti_dir);
return true;
}
const char *path;
char dir[PATH_MAX];
+ if (pkg_id == NULL)
+ return NULL;
+
tzplatform_set_user(uid);
path = tzplatform_getenv(TZ_USER_APP);
tzplatform_reset_user();
- if (pkg_id == NULL || path == NULL)
+ if (path == NULL)
return NULL;
snprintf(dir, sizeof(dir), "%s/%s/%s", path, pkg_id, NOTI_PRIV_DATA_DIR);
handle, req_data->app_id);
if (ret != SECURITY_MANAGER_SUCCESS) {
ret = NOTIFICATION_ERROR_IO_ERROR;
- ERR(
- "Failed to set owner appid(%s) %d",
+ ERR("Failed to set owner appid(%s) %d",
req_data->app_id, ret);
goto out;
}
}
req_data->target_app_table = g_list_append(
- req_data->target_app_table,
- app_info);
+ req_data->target_app_table, app_info);
}
out:
if (handle != NULL)
security_manager_private_sharing_req_free(handle);
+
if (path_array != NULL)
free(path_array);
req_data->app_id);
if (ret != SECURITY_MANAGER_SUCCESS) {
/* LCOV_EXCL_START */
- ERR("Failed to set owner appid[%s][%d]",
- req_data->app_id, ret);
+ ERR("Failed to set owner appid[%s][%d]", req_data->app_id, ret);
ret = NOTIFICATION_ERROR_IO_ERROR;
goto out;
/* LCOV_EXCL_STOP */
out:
if (handle != NULL)
security_manager_private_sharing_req_free(handle);
+
if (path_array != NULL)
free(path_array);
for (iter = new_file_list; iter != NULL; iter = g_list_next(iter)) {
tmp = NULL;
file_info = iter->data;
- if (is_overlapping == true)
- tmp = g_list_find_custom(
- req_data->shared_file_list, file_info,
- __comp_file_info);
+ if (is_overlapping) {
+ tmp = g_list_find_custom(req_data->shared_file_list,
+ file_info, __comp_file_info);
+ }
if (tmp == NULL) {
dup_file_info = __dup_file_info(file_info);
}
if (__set_sharing_for_new_target(req_data, uid_info->target_app_list)
- != NOTIFICATION_ERROR_NONE) {
+ != NOTIFICATION_ERROR_NONE) {
ret = NOTIFICATION_ERROR_IO_ERROR;
goto out;
}
out:
if (new_file_list != NULL)
g_list_free_full(new_file_list, __free_file_info);
+
if (ret != NOTIFICATION_ERROR_NONE)
req_data->priv_id_list = g_list_remove(req_data->priv_id_list,
GINT_TO_POINTER(noti->priv_id));
priv_id_info->data);
uid_info->sharing_req_list = g_list_remove(uid_info->sharing_req_list,
- req_data);
+ req_data);
__free_req_info(req_data);
out:
if (path_array)
free(path_array);
}
-