mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 18:47:39 -04:00
3.7 branch: backport r28418 (disktidy: handles user abort properly)
git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_7@28651 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
49dabd5da8
commit
0743f21d57
1 changed files with 5 additions and 13 deletions
|
@ -244,7 +244,6 @@ enum tidy_return tidy_removedir(char *path, int *path_length)
|
||||||
/* silent error */
|
/* silent error */
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
||||||
struct dirinfo info = rb->dir_get_info(dir, entry);
|
struct dirinfo info = rb->dir_get_info(dir, entry);
|
||||||
if (info.attribute & ATTR_DIRECTORY)
|
if (info.attribute & ATTR_DIRECTORY)
|
||||||
{
|
{
|
||||||
|
@ -252,7 +251,7 @@ enum tidy_return tidy_removedir(char *path, int *path_length)
|
||||||
if ((rb->strcmp(entry->d_name, ".") != 0) && \
|
if ((rb->strcmp(entry->d_name, ".") != 0) && \
|
||||||
(rb->strcmp(entry->d_name, "..") != 0))
|
(rb->strcmp(entry->d_name, "..") != 0))
|
||||||
{
|
{
|
||||||
tidy_removedir(path, path_length);
|
status = tidy_removedir(path, path_length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -284,7 +283,6 @@ enum tidy_return tidy_clean(char *path, int *path_length)
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
enum tidy_return status = TIDY_RETURN_OK;
|
enum tidy_return status = TIDY_RETURN_OK;
|
||||||
int button;
|
int button;
|
||||||
int del; /* has the item been deleted */
|
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
int old_path_length = *path_length;
|
int old_path_length = *path_length;
|
||||||
|
|
||||||
|
@ -321,8 +319,6 @@ enum tidy_return tidy_clean(char *path, int *path_length)
|
||||||
if ((rb->strcmp(entry->d_name, ".") != 0) && \
|
if ((rb->strcmp(entry->d_name, ".") != 0) && \
|
||||||
(rb->strcmp(entry->d_name, "..") != 0))
|
(rb->strcmp(entry->d_name, "..") != 0))
|
||||||
{
|
{
|
||||||
del = 0;
|
|
||||||
|
|
||||||
/* get absolute path */
|
/* get absolute path */
|
||||||
/* returns an error if path is too long */
|
/* returns an error if path is too long */
|
||||||
if(!tidy_path_append_entry(path, entry, path_length))
|
if(!tidy_path_append_entry(path, entry, path_length))
|
||||||
|
@ -332,11 +328,9 @@ enum tidy_return tidy_clean(char *path, int *path_length)
|
||||||
if (tidy_remove_item(entry->d_name, info.attribute))
|
if (tidy_remove_item(entry->d_name, info.attribute))
|
||||||
{
|
{
|
||||||
/* delete dir */
|
/* delete dir */
|
||||||
tidy_removedir(path, path_length);
|
status = tidy_removedir(path, path_length);
|
||||||
del = 1;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (del == 0)
|
|
||||||
{
|
{
|
||||||
/* dir not deleted so clean it */
|
/* dir not deleted so clean it */
|
||||||
status = tidy_clean(path, path_length);
|
status = tidy_clean(path, path_length);
|
||||||
|
@ -349,7 +343,6 @@ enum tidy_return tidy_clean(char *path, int *path_length)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* file */
|
/* file */
|
||||||
del = 0;
|
|
||||||
if (tidy_remove_item(entry->d_name, info.attribute))
|
if (tidy_remove_item(entry->d_name, info.attribute))
|
||||||
{
|
{
|
||||||
/* get absolute path */
|
/* get absolute path */
|
||||||
|
@ -361,7 +354,6 @@ enum tidy_return tidy_clean(char *path, int *path_length)
|
||||||
removed++; /* increment removed files counter */
|
removed++; /* increment removed files counter */
|
||||||
/* delete file */
|
/* delete file */
|
||||||
rb->remove(path);
|
rb->remove(path);
|
||||||
del = 1;
|
|
||||||
|
|
||||||
/* restore path */
|
/* restore path */
|
||||||
tidy_path_remove_entry(path, old_path_length, path_length);
|
tidy_path_remove_entry(path, old_path_length, path_length);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue