提交 f82be437 编写于 作者: M mucor

change while loop to for loop

Change-Id: Ie5c0cbca1e94c97ee2f511bf5ee3cdfb8c085a79
上级 f2e1e18f
...@@ -247,7 +247,6 @@ out: ...@@ -247,7 +247,6 @@ out:
int update_file_path(const char *old_path, const char *new_path) int update_file_path(const char *old_path, const char *new_path)
{ {
unsigned int i = 3;
struct filelist *f_list = NULL; struct filelist *f_list = NULL;
struct file *filp = NULL; struct file *filp = NULL;
int ret; int ret;
...@@ -260,12 +259,11 @@ int update_file_path(const char *old_path, const char *new_path) ...@@ -260,12 +259,11 @@ int update_file_path(const char *old_path, const char *new_path)
} }
(VOID)LOS_MuxLock(&g_file_mapping.lock, LOS_WAIT_FOREVER); (VOID)LOS_MuxLock(&g_file_mapping.lock, LOS_WAIT_FOREVER);
while (i < CONFIG_NFILE_DESCRIPTORS) { for (int i = 3; i < CONFIG_NFILE_DESCRIPTORS; i++) {
i++; if (!get_bit(i)) {
if (!get_bit(i - 1)) {
continue; continue;
} }
filp = &tg_filelist.fl_files[i - 1]; filp = &tg_filelist.fl_files[i];
if (filp->f_path == NULL || strcmp(filp->f_path, old_path)) { if (filp->f_path == NULL || strcmp(filp->f_path, old_path)) {
continue; continue;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册