testing/fstest: add cleanup to fatutf8
Signed-off-by: fanzhuyun <fanzhuyun@xiaomi.com>
This commit is contained in:
parent
e0e41c5d7f
commit
2dde296d4f
@ -60,7 +60,7 @@ int main(int argc, FAR char *argv[])
|
|||||||
int len;
|
int len;
|
||||||
|
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char path[256];
|
char path[PATH_MAX];
|
||||||
|
|
||||||
char *basepath = NULL;
|
char *basepath = NULL;
|
||||||
|
|
||||||
@ -166,5 +166,33 @@ int main(int argc, FAR char *argv[])
|
|||||||
exit(fd);
|
exit(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
ret = remove(path);
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
printf("removed %s\n", path);
|
||||||
|
basepath = strrchr(path, '/');
|
||||||
|
if (basepath != NULL)
|
||||||
|
{
|
||||||
|
*basepath = '\0';
|
||||||
|
ret = remove(path);
|
||||||
|
if (ret == 0)
|
||||||
|
{
|
||||||
|
printf("removed %s\n", path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("remove failed: %d\n", errno);
|
||||||
|
exit(ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("remove failed: %d\n", errno);
|
||||||
|
exit(ret);
|
||||||
|
}
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user