if (d->d_name[0] == '.') {
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
if (strcmp(d->d_name, trash) == 0) {
MS_DBG_ERR("trash directory");
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
if (ms_strappend(path, sizeof(path), "%s/%s", current_path, d->d_name) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("ms_strappend failed");
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
if (d->d_type == DT_REG) {
if (!ms_check_support_media_type(handle, path)) {
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
MS_DBG_ERR("I/O ERROR COUNT[%d]", io_err_folder++);
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
} else {
++scan_count;
if (ms_insert_folder(handle, storage_id, path, uid) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("insert folder failed");
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
}
}
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
}
/*update modifiec type for the internal storage*/
if (scan_type == MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE) {
else
ms_update_folder_time(handle, storage_id, current_path, uid);
}
+ usleep(SCAN_SLEEP_TIME);
}
ms_insert_folder_end(handle, uid);
MS_SAFE_FREE(current_path);
__msc_set_dir_scan_cur_path(NULL);
+ usleep(SCAN_SLEEP_TIME);
}
goto END_SCAN;
if (strcmp(d->d_name, trash) == 0) {
MS_DBG_ERR("trash directory");
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
if (ms_strappend(path, sizeof(path), "%s/%s", current_path, d->d_name) != MS_MEDIA_ERR_NONE) {
MS_DBG_ERR("ms_strappend failed");
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
/* check media type */
if (!ms_check_support_media_type(handle, path)) {
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
}
MS_DBG_ERR("I/O ERROR COUNT[%d]", io_err_storage++);
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
continue;
} else {
++scan_count;
}
bpos += d->d_reclen;
+ usleep(SCAN_SLEEP_TIME);
}
+ usleep(SCAN_SLEEP_TIME);
}
ms_insert_folder_end(handle, uid);
break;
}
}
+ usleep(SCAN_SLEEP_TIME);
}
if (strstr(new_start_path, MEDIA_ROOT_PATH_USB) != NULL) {
/*disconnect form media db*/
if (handle) ms_disconnect_db(&handle);
+ usleep(SCAN_SLEEP_TIME);
} /*thread while*/
_POWEROFF:
MS_DBG_WARN("STORAGE SCAN END[%d]", ret);
io_err_storage = 0;
+ usleep(SCAN_SLEEP_TIME);
} /*thread while*/
_POWEROFF: