mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
vfs_s_subclass::linear_read: return ssize_t instead of int.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
48c3be0a72
commit
9678bdc3ef
@ -1338,7 +1338,8 @@ vfs_s_retrieve_file (struct vfs_class *me, struct vfs_s_inode *ino)
|
|||||||
/* If you want reget, you'll have to open file with O_LINEAR */
|
/* If you want reget, you'll have to open file with O_LINEAR */
|
||||||
off_t total = 0;
|
off_t total = 0;
|
||||||
char buffer[8192];
|
char buffer[8192];
|
||||||
int handle, n;
|
int handle;
|
||||||
|
ssize_t n;
|
||||||
off_t stat_size = ino->st.st_size;
|
off_t stat_size = ino->st.st_size;
|
||||||
vfs_file_handler_t fh;
|
vfs_file_handler_t fh;
|
||||||
vfs_path_t *tmp_vpath;
|
vfs_path_t *tmp_vpath;
|
||||||
|
@ -147,7 +147,7 @@ struct vfs_s_subclass
|
|||||||
int (*file_store) (struct vfs_class * me, vfs_file_handler_t * fh, char *path, char *localname);
|
int (*file_store) (struct vfs_class * me, vfs_file_handler_t * fh, char *path, char *localname);
|
||||||
|
|
||||||
int (*linear_start) (struct vfs_class * me, vfs_file_handler_t * fh, off_t from);
|
int (*linear_start) (struct vfs_class * me, vfs_file_handler_t * fh, off_t from);
|
||||||
int (*linear_read) (struct vfs_class * me, vfs_file_handler_t * fh, void *buf, size_t len);
|
ssize_t (*linear_read) (struct vfs_class * me, vfs_file_handler_t * fh, void *buf, size_t len);
|
||||||
void (*linear_close) (struct vfs_class * me, vfs_file_handler_t * fh);
|
void (*linear_close) (struct vfs_class * me, vfs_file_handler_t * fh);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1057,14 +1057,13 @@ fish_linear_abort (struct vfs_class *me, vfs_file_handler_t * fh)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
fish_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size_t len)
|
fish_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size_t len)
|
||||||
{
|
{
|
||||||
fish_fh_data_t *fish = (fish_fh_data_t *) fh->data;
|
fish_fh_data_t *fish = (fish_fh_data_t *) fh->data;
|
||||||
struct vfs_s_super *super = FH_SUPER;
|
struct vfs_s_super *super = FH_SUPER;
|
||||||
ssize_t n = 0;
|
ssize_t n = 0;
|
||||||
|
|
||||||
|
|
||||||
len = MIN ((size_t) (fish->total - fish->got), len);
|
len = MIN ((size_t) (fish->total - fish->got), len);
|
||||||
tty_disable_interrupt_key ();
|
tty_disable_interrupt_key ();
|
||||||
while (len != 0 && ((n = read (SUP->sockr, buf, len)) < 0))
|
while (len != 0 && ((n = read (SUP->sockr, buf, len)) < 0))
|
||||||
|
@ -1896,7 +1896,7 @@ ftpfs_linear_start (struct vfs_class *me, vfs_file_handler_t * fh, off_t offset)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
ftpfs_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size_t len)
|
ftpfs_linear_read (struct vfs_class *me, vfs_file_handler_t * fh, void *buf, size_t len)
|
||||||
{
|
{
|
||||||
ssize_t n;
|
ssize_t n;
|
||||||
|
Loading…
Reference in New Issue
Block a user