mirror of https://github.com/MidnightCommander/mc
Clarify usage of sftpfs_internal_stat() return value.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
77a273a0fd
commit
a3b54e4003
|
@ -290,12 +290,13 @@ sftpfs_lstat (const vfs_path_t * vpath, struct stat *buf, GError ** mcerror)
|
|||
int res;
|
||||
|
||||
res = sftpfs_stat_init (&super_data, &path_element, vpath, mcerror, LIBSSH2_SFTP_LSTAT, &attrs);
|
||||
if (res == -1 || res == -EACCES || res == -ENOENT)
|
||||
return res;
|
||||
if (res >= 0)
|
||||
{
|
||||
sftpfs_attr_to_stat (&attrs, buf);
|
||||
res = 0;
|
||||
}
|
||||
|
||||
sftpfs_attr_to_stat (&attrs, buf);
|
||||
|
||||
return 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -317,14 +318,14 @@ sftpfs_stat (const vfs_path_t * vpath, struct stat *buf, GError ** mcerror)
|
|||
int res;
|
||||
|
||||
res = sftpfs_stat_init (&super_data, &path_element, vpath, mcerror, LIBSSH2_SFTP_STAT, &attrs);
|
||||
if (res == -1 || res == -EACCES || res == -ENOENT)
|
||||
return res;
|
||||
if (res >= 0)
|
||||
{
|
||||
buf->st_nlink = 1;
|
||||
sftpfs_attr_to_stat (&attrs, buf);
|
||||
res = 0;
|
||||
}
|
||||
|
||||
buf->st_nlink = 1;
|
||||
|
||||
sftpfs_attr_to_stat (&attrs, buf);
|
||||
|
||||
return 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
@ -438,7 +439,7 @@ sftpfs_chmod (const vfs_path_t * vpath, mode_t mode, GError ** mcerror)
|
|||
int res;
|
||||
|
||||
res = sftpfs_stat_init (&super_data, &path_element, vpath, mcerror, LIBSSH2_SFTP_LSTAT, &attrs);
|
||||
if (res == -1 || res == -EACCES || res == -ENOENT)
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
attrs.permissions = mode;
|
||||
|
|
Loading…
Reference in New Issue