mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Simplify _readdir function of the smb module.
This commit is contained in:
parent
de86c0ba6b
commit
05253be461
1 changed files with 2 additions and 11 deletions
|
@ -293,16 +293,12 @@ static csync_vio_file_stat_t *_readdir(csync_vio_method_handle_t *dhandle) {
|
|||
errno = 0;
|
||||
dirent = smbc_readdir(handle->dh);
|
||||
if (dirent == NULL) {
|
||||
if (errno) {
|
||||
goto err;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
file_stat = c_malloc(sizeof(csync_vio_file_stat_t));
|
||||
if (file_stat == NULL) {
|
||||
goto err;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
file_stat->name = c_strndup(dirent->name, dirent->namelen);
|
||||
|
@ -332,11 +328,6 @@ static csync_vio_file_stat_t *_readdir(csync_vio_method_handle_t *dhandle) {
|
|||
}
|
||||
|
||||
return file_stat;
|
||||
|
||||
err:
|
||||
SAFE_FREE(file_stat);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int _mkdir(const char *uri, mode_t mode) {
|
||||
|
|
Loading…
Reference in a new issue