[dart:io] Remove double-close from recursive directory delete
closedir() closes the file descriptor wrapped by the DIR, so we shouldn't close it again. R=bkonyi@google.com Review-Url: https://codereview.chromium.org/3005883002 .
This commit is contained in:
@@ -303,7 +303,6 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
|
||||
}
|
||||
// End of directory.
|
||||
int status = NO_RETRY_EXPECTED(closedir(dir_pointer));
|
||||
FDUtils::SaveErrorAndClose(fd);
|
||||
if (status != 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -364,7 +363,6 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
|
||||
ASSERT(errno != 0);
|
||||
int err = errno;
|
||||
VOID_NO_RETRY_EXPECTED(closedir(dir_pointer));
|
||||
FDUtils::SaveErrorAndClose(fd);
|
||||
errno = err;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -413,7 +413,6 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
|
||||
}
|
||||
// End of directory.
|
||||
int status = NO_RETRY_EXPECTED(closedir(dir_pointer));
|
||||
FDUtils::SaveErrorAndClose(fd);
|
||||
if (status != 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -474,7 +473,6 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
|
||||
ASSERT(errno != 0);
|
||||
int err = errno;
|
||||
VOID_NO_RETRY_EXPECTED(closedir(dir_pointer));
|
||||
FDUtils::SaveErrorAndClose(fd);
|
||||
errno = err;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -303,7 +303,6 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
|
||||
}
|
||||
// End of directory.
|
||||
int status = NO_RETRY_EXPECTED(closedir(dir_pointer));
|
||||
FDUtils::SaveErrorAndClose(fd);
|
||||
if (status != 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -364,7 +363,6 @@ static bool DeleteRecursively(int dirfd, PathBuffer* path) {
|
||||
ASSERT(errno != 0);
|
||||
int err = errno;
|
||||
VOID_NO_RETRY_EXPECTED(closedir(dir_pointer));
|
||||
FDUtils::SaveErrorAndClose(fd);
|
||||
errno = err;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user