mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
vio_local: Simplify and fix the error out behaviour of win32 impl.
This avoids leaking of a stat struct in error case.
This commit is contained in:
parent
1a69e2ae8d
commit
4cb78999d2
1 changed files with 2 additions and 9 deletions
|
@ -150,12 +150,9 @@ csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
|
|||
// might be error, check!
|
||||
int dwError = GetLastError();
|
||||
if (dwError != ERROR_NO_MORE_FILES) {
|
||||
errno = EACCES; // FIXME: Is this a good errno?
|
||||
goto err;
|
||||
} else {
|
||||
// Normal case that no more is in the dir.
|
||||
return NULL;
|
||||
errno = EACCES; // no more files is fine. Otherwise EACCESS
|
||||
}
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
file_stat->name = c_utf8_from_locale(handle->ffd.cFileName);
|
||||
|
@ -171,11 +168,7 @@ csync_vio_file_stat_t *csync_vio_local_readdir(csync_vio_handle_t *dhandle) {
|
|||
|
||||
dirent = _treaddir(handle->dh);
|
||||
if (dirent == NULL) {
|
||||
if (errno) {
|
||||
goto err;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
file_stat->name = c_utf8_from_locale(dirent->d_name);
|
||||
|
||||
|
|
Loading…
Reference in a new issue