mirror of https://github.com/MidnightCommander/mc
changing return types of *read() and *write() functions to ssize_t
This commit is contained in:
parent
2fa781eeeb
commit
183a66f7f5
|
@ -98,7 +98,7 @@ static int cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super);
|
||||||
static int cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super);
|
static int cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super);
|
||||||
static int cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super);
|
static int cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super);
|
||||||
static int cpio_create_entry(struct vfs_class *me, struct vfs_s_super *super, struct stat *, char *name);
|
static int cpio_create_entry(struct vfs_class *me, struct vfs_s_super *super, struct stat *, char *name);
|
||||||
static int cpio_read(void *fh, char *buffer, int count);
|
static ssize_t cpio_read(void *fh, char *buffer, int count);
|
||||||
|
|
||||||
#define CPIO_POS(super) cpio_position
|
#define CPIO_POS(super) cpio_position
|
||||||
/* If some time reentrancy should be needed change it to */
|
/* If some time reentrancy should be needed change it to */
|
||||||
|
|
|
@ -801,7 +801,7 @@ vfs_s_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||||
return fh;
|
return fh;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
vfs_s_read (void *fh, char *buffer, int count)
|
vfs_s_read (void *fh, char *buffer, int count)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
@ -848,7 +848,7 @@ vfs_s_write (void *fh, const char *buffer, int count)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static off_t
|
||||||
vfs_s_lseek (void *fh, off_t offset, int whence)
|
vfs_s_lseek (void *fh, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
off_t size = FH->ino->st.st_size;
|
off_t size = FH->ino->st.st_size;
|
||||||
|
|
|
@ -724,7 +724,7 @@ extfs_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||||
return extfs_info;
|
return extfs_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int extfs_read (void *data, char *buffer, int count)
|
static ssize_t extfs_read (void *data, char *buffer, int count)
|
||||||
{
|
{
|
||||||
struct pseudofile *file = (struct pseudofile *)data;
|
struct pseudofile *file = (struct pseudofile *)data;
|
||||||
|
|
||||||
|
@ -1016,7 +1016,7 @@ static int extfs_chmod (struct vfs_class *me, const char *path, int mode)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int extfs_write (void *data, const char *buf, int nbyte)
|
static ssize_t extfs_write (void *data, const char *buf, int nbyte)
|
||||||
{
|
{
|
||||||
struct pseudofile *file = (struct pseudofile *)data;
|
struct pseudofile *file = (struct pseudofile *)data;
|
||||||
|
|
||||||
|
@ -1141,7 +1141,7 @@ extfs_chdir (struct vfs_class *me, const char *path)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int extfs_lseek (void *data, off_t offset, int whence)
|
static off_t extfs_lseek (void *data, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
struct pseudofile *file = (struct pseudofile *) data;
|
struct pseudofile *file = (struct pseudofile *) data;
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ local_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||||
return local_info;
|
return local_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
ssize_t
|
||||||
local_read (void *data, char *buffer, int count)
|
local_read (void *data, char *buffer, int count)
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
@ -188,7 +188,7 @@ local_symlink (struct vfs_class *me, const char *n1, const char *n2)
|
||||||
return symlink (n1, n2);
|
return symlink (n1, n2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
local_write (void *data, const char *buf, int nbyte)
|
local_write (void *data, const char *buf, int nbyte)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -226,7 +226,7 @@ local_chdir (struct vfs_class *me, const char *path)
|
||||||
return chdir (path);
|
return chdir (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
off_t
|
||||||
local_lseek (void *data, off_t offset, int whence)
|
local_lseek (void *data, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
int fd = * (int *) data;
|
int fd = * (int *) data;
|
||||||
|
|
|
@ -8,9 +8,9 @@ extern void init_localfs (void);
|
||||||
/* these functions are used by other filesystems, so they are
|
/* these functions are used by other filesystems, so they are
|
||||||
* published here. */
|
* published here. */
|
||||||
extern int local_close (void *data);
|
extern int local_close (void *data);
|
||||||
extern int local_read (void *data, char *buffer, int count);
|
extern ssize_t local_read (void *data, char *buffer, int count);
|
||||||
extern int local_fstat (void *data, struct stat *buf);
|
extern int local_fstat (void *data, struct stat *buf);
|
||||||
extern int local_errno (struct vfs_class *me);
|
extern int local_errno (struct vfs_class *me);
|
||||||
extern int local_lseek (void *data, off_t offset, int whence);
|
extern off_t local_lseek (void *data, off_t offset, int whence);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -551,7 +551,7 @@ mcfs_open (struct vfs_class *me, const char *file, int flags, int mode)
|
||||||
return remote_handle;
|
return remote_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
mcfs_read (void *data, char *buffer, int count)
|
mcfs_read (void *data, char *buffer, int count)
|
||||||
{
|
{
|
||||||
mcfs_handle *info = (mcfs_handle *) data;
|
mcfs_handle *info = (mcfs_handle *) data;
|
||||||
|
@ -578,7 +578,7 @@ mcfs_read (void *data, char *buffer, int count)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
mcfs_write (void *data, const char *buf, int nbyte)
|
mcfs_write (void *data, const char *buf, int nbyte)
|
||||||
{
|
{
|
||||||
mcfs_handle *info = (mcfs_handle *) data;
|
mcfs_handle *info = (mcfs_handle *) data;
|
||||||
|
@ -1069,7 +1069,7 @@ mcfs_chdir (struct vfs_class *me, const char *path)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static off_t
|
||||||
mcfs_lseek (void *data, off_t offset, int whence)
|
mcfs_lseek (void *data, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
mcfs_handle *info = (mcfs_handle *) data;
|
mcfs_handle *info = (mcfs_handle *) data;
|
||||||
|
|
|
@ -366,7 +366,7 @@ smbfs_fill_names (struct vfs_class *me, fill_names_f func)
|
||||||
#define GNAL_VNC(s) unix_to_dos(s,False)
|
#define GNAL_VNC(s) unix_to_dos(s,False)
|
||||||
/* does same as do_get() in client.c */
|
/* does same as do_get() in client.c */
|
||||||
/* called from vfs.c:1080, count = buffer size */
|
/* called from vfs.c:1080, count = buffer size */
|
||||||
static int
|
static ssize_t
|
||||||
smbfs_read (void *data, char *buffer, int count)
|
smbfs_read (void *data, char *buffer, int count)
|
||||||
{
|
{
|
||||||
smbfs_handle *info = (smbfs_handle *) data;
|
smbfs_handle *info = (smbfs_handle *) data;
|
||||||
|
@ -380,7 +380,7 @@ smbfs_read (void *data, char *buffer, int count)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
smbfs_write (void *data, const char *buf, int nbyte)
|
smbfs_write (void *data, const char *buf, int nbyte)
|
||||||
{
|
{
|
||||||
smbfs_handle *info = (smbfs_handle *) data;
|
smbfs_handle *info = (smbfs_handle *) data;
|
||||||
|
@ -1625,7 +1625,7 @@ smbfs_stat (struct vfs_class * me, const char *path, struct stat *buf)
|
||||||
|
|
||||||
#define smbfs_lstat smbfs_stat /* no symlinks on smb filesystem? */
|
#define smbfs_lstat smbfs_stat /* no symlinks on smb filesystem? */
|
||||||
|
|
||||||
static int
|
static off_t
|
||||||
smbfs_lseek (void *data, off_t offset, int whence)
|
smbfs_lseek (void *data, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
smbfs_handle *info = (smbfs_handle *) data;
|
smbfs_handle *info = (smbfs_handle *) data;
|
||||||
|
|
|
@ -745,7 +745,7 @@ tar_super_same (struct vfs_class *me, struct vfs_s_super *parc,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tar_read (void *fh, char *buffer, int count)
|
static ssize_t tar_read (void *fh, char *buffer, int count)
|
||||||
{
|
{
|
||||||
off_t begin = FH->ino->data_offset;
|
off_t begin = FH->ino->data_offset;
|
||||||
int fd = FH_SUPER->u.arch.fd;
|
int fd = FH_SUPER->u.arch.fd;
|
||||||
|
|
|
@ -84,7 +84,7 @@ static struct lsdel_struct lsd;
|
||||||
static struct deleted_info *delarray;
|
static struct deleted_info *delarray;
|
||||||
static int num_delarray, max_delarray;
|
static int num_delarray, max_delarray;
|
||||||
static char *block_buf;
|
static char *block_buf;
|
||||||
static char *undelfserr = N_(" undelfs: error ");
|
static const char *undelfserr = N_(" undelfs: error ");
|
||||||
static int readdir_ptr;
|
static int readdir_ptr;
|
||||||
static int undelfs_usage;
|
static int undelfs_usage;
|
||||||
static struct vfs_class vfs_undelfs_ops;
|
static struct vfs_class vfs_undelfs_ops;
|
||||||
|
@ -520,7 +520,7 @@ undelfs_dump_read(ext2_filsys fs, blk_t *blocknr, int blockcnt, void *private)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static ssize_t
|
||||||
undelfs_read (void *vfs_info, char *buffer, int count)
|
undelfs_read (void *vfs_info, char *buffer, int count)
|
||||||
{
|
{
|
||||||
undelfs_file *p = vfs_info;
|
undelfs_file *p = vfs_info;
|
||||||
|
@ -649,7 +649,7 @@ undelfs_chdir(struct vfs_class *me, const char *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this has to stay here for now: vfs layer does not know how to emulate it */
|
/* this has to stay here for now: vfs layer does not know how to emulate it */
|
||||||
static int
|
static off_t
|
||||||
undelfs_lseek(void *vfs_info, off_t offset, int whence)
|
undelfs_lseek(void *vfs_info, off_t offset, int whence)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -46,8 +46,8 @@ struct vfs_class {
|
||||||
void *(*open) (struct vfs_class *me, const char *fname, int flags,
|
void *(*open) (struct vfs_class *me, const char *fname, int flags,
|
||||||
int mode);
|
int mode);
|
||||||
int (*close) (void *vfs_info);
|
int (*close) (void *vfs_info);
|
||||||
int (*read) (void *vfs_info, char *buffer, int count);
|
ssize_t (*read) (void *vfs_info, char *buffer, int count);
|
||||||
int (*write) (void *vfs_info, const char *buf, int count);
|
ssize_t (*write) (void *vfs_info, const char *buf, int count);
|
||||||
|
|
||||||
void *(*opendir) (struct vfs_class *me, const char *dirname);
|
void *(*opendir) (struct vfs_class *me, const char *dirname);
|
||||||
void *(*readdir) (void *vfs_info);
|
void *(*readdir) (void *vfs_info);
|
||||||
|
@ -70,7 +70,7 @@ struct vfs_class {
|
||||||
int (*rename) (struct vfs_class *me, const char *p1, const char *p2);
|
int (*rename) (struct vfs_class *me, const char *p1, const char *p2);
|
||||||
int (*chdir) (struct vfs_class *me, const char *path);
|
int (*chdir) (struct vfs_class *me, const char *path);
|
||||||
int (*ferrno) (struct vfs_class *me);
|
int (*ferrno) (struct vfs_class *me);
|
||||||
int (*lseek) (void *vfs_info, off_t offset, int whence);
|
off_t (*lseek) (void *vfs_info, off_t offset, int whence);
|
||||||
int (*mknod) (struct vfs_class *me, const char *path, int mode, int dev);
|
int (*mknod) (struct vfs_class *me, const char *path, int mode, int dev);
|
||||||
|
|
||||||
vfsid (*getid) (struct vfs_class *me, const char *path);
|
vfsid (*getid) (struct vfs_class *me, const char *path);
|
||||||
|
|
|
@ -15,8 +15,8 @@ int vfs_file_is_local (const char *filename);
|
||||||
|
|
||||||
int mc_open (const char *filename, int flags, ...);
|
int mc_open (const char *filename, int flags, ...);
|
||||||
int mc_close (int handle);
|
int mc_close (int handle);
|
||||||
int mc_read (int handle, void *buffer, int count);
|
ssize_t mc_read (int handle, void *buffer, int count);
|
||||||
int mc_write (int handle, const void *buffer, int count);
|
ssize_t mc_write (int handle, const void *buffer, int count);
|
||||||
off_t mc_lseek (int fd, off_t offset, int whence);
|
off_t mc_lseek (int fd, off_t offset, int whence);
|
||||||
int mc_chdir (const char *path);
|
int mc_chdir (const char *path);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue