MSAPI_RETVM_IF(!ms_ipc_is_valid_msg(request_msg), MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid request_msg");
- MSAPI_DBG("REQUEST UPDATE ASYNC [%d][%s]", msg_type, request_msg);
+ MSAPI_DBG_SLOG("REQUEST UPDATE ASYNC [%d][%s]", msg_type, request_msg);
request_msg_size = strlen(request_msg);
if (request_msg[request_msg_size - 1] == '/') {
request_path = g_strdup(request_msg);
}
- MSAPI_DBG("querysize[%d] path[%s] query[%s]", request_msg_size, request_msg, request_path);
+ MSAPI_DBG_SLOG("querysize[%d] path[%s] query[%s]", request_msg_size, request_msg, request_path);
memset((void *)&send_msg, 0, sizeof(ms_comm_msg_s));
send_msg.msg_type = msg_type;
ms_batch_commit_disable(uid);
ms_batch_commit_enable(false, pid);
- current_path = g_ptr_array_index(dir_array , 0);
+ current_path = g_ptr_array_index(dir_array, 0);
g_ptr_array_remove_index(dir_array, 0);
__msc_set_dir_scan_cur_path(current_path);
int ret = MS_MEDIA_ERR_NONE;
char *new_path = NULL;
char *current_path = NULL;
- char path[MS_FILE_PATH_LEN_MAX] = { 0 };
+ char path[MS_FILE_PATH_LEN_MAX] = {0, };
int (*scan_function)(sqlite3 *, const char*, const char*, uid_t) = NULL;
char *new_start_path = NULL;
MS_SAFE_FREE(current_path);
if (ret == MS_MEDIA_ERR_USB_UNMOUNTED)
goto STOP_SCAN;
- else
- ret = MS_MEDIA_ERR_NONE;
+ ret = MS_MEDIA_ERR_NONE;
continue;
}
gpointer msc_storage_scan_thread(gpointer data)
{
- ms_comm_msg_s *scan_data = NULL;
int ret = MS_MEDIA_ERR_NONE;
+ ms_comm_msg_s *scan_data = NULL;
sqlite3 *handle = NULL;
ms_user_storage_type_e storage_type = MS_USER_STORAGE_INTERNAL;
goto _POWEROFF;
}
- MS_DBG_WARN("STORAGE SCAN START [%.*s]", MAX_MSG_SIZE, scan_data->msg);
+ MS_DBG_WARN("STORAGE SCAN START [%.*s][%s]", MAX_MSG_SIZE, scan_data->msg, scan_data->storage_id);
if (scan_data->msg_type != MS_MSG_STORAGE_ALL &&
scan_data->msg_type != MS_MSG_STORAGE_PARTIAL &&
MS_DBG_RETVM_IF(!scan_data, MS_MEDIA_ERR_INVALID_PARAMETER, "scan_data is NULL");
ret = ms_set_folder_validity(handle, scan_data->storage_id, scan_data->msg, MS_SCANNING, is_recursive, scan_data->uid);
- MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "set_folder_validity failed");
+ MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "ms_set_folder_validity failed");
ret = ms_set_folder_item_validity(handle, scan_data->storage_id, scan_data->msg, MS_SCANNING, is_recursive, scan_data->uid);
MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "ms_set_folder_item_validity failed");
while (1) {
scan_data = g_async_queue_pop(storage_queue);
if (scan_data->pid == POWEROFF) {
- MS_DBG_WARN("power off");
+ MS_DBG_ERR("power off");
goto _POWEROFF;
}
if (ms_ipc_create_server_socket(MS_SCANNER_PORT, &sockfd) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("Failed to create socket");
return -1;
- } else {
- if (ms_cynara_enable_credentials_passing(sockfd) != MS_MEDIA_ERR_NONE)
- MS_DBG_ERR("Failed to setup credential passing");
-
- channel = g_io_channel_unix_new(sockfd);
- g_io_channel_set_close_on_unref(channel, TRUE);
- main_source_id = g_io_add_watch(channel, G_IO_IN, ms_read_socket, NULL);
- g_io_channel_unref(channel);
}
+ if (ms_cynara_enable_credentials_passing(sockfd) != MS_MEDIA_ERR_NONE)
+ MS_DBG_ERR("Failed to setup credential passing");
+
+ channel = g_io_channel_unix_new(sockfd);
+ g_io_channel_set_close_on_unref(channel, TRUE);
+ main_source_id = g_io_add_watch(channel, G_IO_IN, ms_read_socket, NULL);
+ g_io_channel_unref(channel);
+
/* recevie event from other modules */
__ms_add_event_receiver();