!615 shell命令中rm -r指令尝试删除/dev下节点系统出错

Merge pull request !615 from 高荣鑫/OpenHarmony_1.0.1_release
This commit is contained in:
openharmony_ci 2021-09-09 06:40:27 +00:00 committed by Gitee
commit de82bf893a
1 changed files with 4 additions and 0 deletions

View File

@ -838,6 +838,10 @@ static int os_shell_cmd_do_rmdir(const char *pathname)
return remove(pathname); return remove(pathname);
} }
d = opendir(pathname); d = opendir(pathname);
if (d == NULL)
{
return -1;
}
while (1) while (1)
{ {
dirent = readdir(d); dirent = readdir(d);