From 183a66f7f50282c62511af0f5c0fc73ff9cbe3fb Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Tue, 13 Jan 2009 19:00:25 +0100 Subject: [PATCH] changing return types of *read() and *write() functions to ssize_t --- vfs/cpio.c | 2 +- vfs/direntry.c | 4 ++-- vfs/extfs.c | 6 +++--- vfs/local.c | 6 +++--- vfs/local.h | 4 ++-- vfs/mcfs.c | 6 +++--- vfs/smbfs.c | 6 +++--- vfs/tar.c | 2 +- vfs/undelfs.c | 6 +++--- vfs/vfs-impl.h | 6 +++--- vfs/vfs.h | 4 ++-- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/vfs/cpio.c b/vfs/cpio.c index fb93d9a2e..167d742e8 100644 --- a/vfs/cpio.c +++ b/vfs/cpio.c @@ -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_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_read(void *fh, char *buffer, int count); +static ssize_t cpio_read(void *fh, char *buffer, int count); #define CPIO_POS(super) cpio_position /* If some time reentrancy should be needed change it to */ diff --git a/vfs/direntry.c b/vfs/direntry.c index 3a52d2229..52e706589 100644 --- a/vfs/direntry.c +++ b/vfs/direntry.c @@ -801,7 +801,7 @@ vfs_s_open (struct vfs_class *me, const char *file, int flags, int mode) return fh; } -static int +static ssize_t vfs_s_read (void *fh, char *buffer, int count) { int n; @@ -848,7 +848,7 @@ vfs_s_write (void *fh, const char *buffer, int count) return 0; } -static int +static off_t vfs_s_lseek (void *fh, off_t offset, int whence) { off_t size = FH->ino->st.st_size; diff --git a/vfs/extfs.c b/vfs/extfs.c index d634e3309..1306c5bcb 100644 --- a/vfs/extfs.c +++ b/vfs/extfs.c @@ -724,7 +724,7 @@ extfs_open (struct vfs_class *me, const char *file, int flags, int mode) 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; @@ -1016,7 +1016,7 @@ static int extfs_chmod (struct vfs_class *me, const char *path, int mode) 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; @@ -1141,7 +1141,7 @@ extfs_chdir (struct vfs_class *me, const char *path) 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; diff --git a/vfs/local.c b/vfs/local.c index 3a539191b..9ed245a3e 100644 --- a/vfs/local.c +++ b/vfs/local.c @@ -39,7 +39,7 @@ local_open (struct vfs_class *me, const char *file, int flags, int mode) return local_info; } -int +ssize_t local_read (void *data, char *buffer, int count) { int n; @@ -188,7 +188,7 @@ local_symlink (struct vfs_class *me, const char *n1, const char *n2) return symlink (n1, n2); } -static int +static ssize_t local_write (void *data, const char *buf, int nbyte) { int fd; @@ -226,7 +226,7 @@ local_chdir (struct vfs_class *me, const char *path) return chdir (path); } -int +off_t local_lseek (void *data, off_t offset, int whence) { int fd = * (int *) data; diff --git a/vfs/local.h b/vfs/local.h index daa894002..03d5ce29a 100644 --- a/vfs/local.h +++ b/vfs/local.h @@ -8,9 +8,9 @@ extern void init_localfs (void); /* these functions are used by other filesystems, so they are * published here. */ 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_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 diff --git a/vfs/mcfs.c b/vfs/mcfs.c index 07de5a34e..0261bbc6e 100644 --- a/vfs/mcfs.c +++ b/vfs/mcfs.c @@ -551,7 +551,7 @@ mcfs_open (struct vfs_class *me, const char *file, int flags, int mode) return remote_handle; } -static int +static ssize_t mcfs_read (void *data, char *buffer, int count) { mcfs_handle *info = (mcfs_handle *) data; @@ -578,7 +578,7 @@ mcfs_read (void *data, char *buffer, int count) return result; } -static int +static ssize_t mcfs_write (void *data, const char *buf, int nbyte) { mcfs_handle *info = (mcfs_handle *) data; @@ -1069,7 +1069,7 @@ mcfs_chdir (struct vfs_class *me, const char *path) return 0; } -static int +static off_t mcfs_lseek (void *data, off_t offset, int whence) { mcfs_handle *info = (mcfs_handle *) data; diff --git a/vfs/smbfs.c b/vfs/smbfs.c index a133fa341..fb3fc97e5 100644 --- a/vfs/smbfs.c +++ b/vfs/smbfs.c @@ -366,7 +366,7 @@ smbfs_fill_names (struct vfs_class *me, fill_names_f func) #define GNAL_VNC(s) unix_to_dos(s,False) /* does same as do_get() in client.c */ /* called from vfs.c:1080, count = buffer size */ -static int +static ssize_t smbfs_read (void *data, char *buffer, int count) { smbfs_handle *info = (smbfs_handle *) data; @@ -380,7 +380,7 @@ smbfs_read (void *data, char *buffer, int count) return n; } -static int +static ssize_t smbfs_write (void *data, const char *buf, int nbyte) { 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? */ -static int +static off_t smbfs_lseek (void *data, off_t offset, int whence) { smbfs_handle *info = (smbfs_handle *) data; diff --git a/vfs/tar.c b/vfs/tar.c index bcde1695a..b9cadc0db 100644 --- a/vfs/tar.c +++ b/vfs/tar.c @@ -745,7 +745,7 @@ tar_super_same (struct vfs_class *me, struct vfs_s_super *parc, 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; int fd = FH_SUPER->u.arch.fd; diff --git a/vfs/undelfs.c b/vfs/undelfs.c index cea0e7991..91d02f00d 100644 --- a/vfs/undelfs.c +++ b/vfs/undelfs.c @@ -84,7 +84,7 @@ static struct lsdel_struct lsd; static struct deleted_info *delarray; static int num_delarray, max_delarray; static char *block_buf; -static char *undelfserr = N_(" undelfs: error "); +static const char *undelfserr = N_(" undelfs: error "); static int readdir_ptr; static int undelfs_usage; 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; } -static int +static ssize_t undelfs_read (void *vfs_info, char *buffer, int count) { 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 */ -static int +static off_t undelfs_lseek(void *vfs_info, off_t offset, int whence) { return -1; diff --git a/vfs/vfs-impl.h b/vfs/vfs-impl.h index 21752ebcd..1039abc54 100644 --- a/vfs/vfs-impl.h +++ b/vfs/vfs-impl.h @@ -46,8 +46,8 @@ struct vfs_class { void *(*open) (struct vfs_class *me, const char *fname, int flags, int mode); int (*close) (void *vfs_info); - int (*read) (void *vfs_info, char *buffer, int count); - int (*write) (void *vfs_info, const char *buf, int count); + ssize_t (*read) (void *vfs_info, char *buffer, int count); + ssize_t (*write) (void *vfs_info, const char *buf, int count); void *(*opendir) (struct vfs_class *me, const char *dirname); 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 (*chdir) (struct vfs_class *me, const char *path); 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); vfsid (*getid) (struct vfs_class *me, const char *path); diff --git a/vfs/vfs.h b/vfs/vfs.h index f7ec56233..d79c706f4 100644 --- a/vfs/vfs.h +++ b/vfs/vfs.h @@ -15,8 +15,8 @@ int vfs_file_is_local (const char *filename); int mc_open (const char *filename, int flags, ...); int mc_close (int handle); -int mc_read (int handle, void *buffer, int count); -int mc_write (int handle, const void *buffer, int count); +ssize_t mc_read (int handle, 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); int mc_chdir (const char *path);