fix:shell cmd rm -r crash when open target dir failed
Change-Id: I1146ab12b02aeef3f9a2a0422ee45936f5e4c105
This commit is contained in:
parent
8592e04c78
commit
749420308e
|
@ -837,6 +837,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);
|
||||||
|
|
Loading…
Reference in New Issue