From 3ca5a91b9abc43026f70126e1069c4c3f337c315 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Sat, 24 Jan 2009 02:34:43 +0100 Subject: [PATCH 1/2] vfs/cpio.c: read functions now return ssize_t --- vfs/cpio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vfs/cpio.c b/vfs/cpio.c index 167d742e8..3d27a626a 100644 --- a/vfs/cpio.c +++ b/vfs/cpio.c @@ -94,10 +94,10 @@ struct defer_inode { static int cpio_position; static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super); -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 ssize_t cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super); +static ssize_t cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super); +static ssize_t cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super); static ssize_t cpio_read(void *fh, char *buffer, int count); #define CPIO_POS(super) cpio_position @@ -198,7 +198,7 @@ cpio_open_cpio_file (struct vfs_class *me, struct vfs_s_super *super, return fd; } -static int cpio_read_head(struct vfs_class *me, struct vfs_s_super *super) +static ssize_t cpio_read_head(struct vfs_class *me, struct vfs_s_super *super) { switch(cpio_find_head(me, super)) { case CPIO_UNKNOWN: @@ -263,7 +263,7 @@ static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super) #undef SEEKBACK #define HEAD_LENGTH (26) -static int cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super) +static ssize_t cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super) { union { struct old_cpio_header buf; @@ -317,7 +317,7 @@ static int cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super) #undef HEAD_LENGTH #define HEAD_LENGTH (76) -static int cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super) +static ssize_t cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super) { struct new_cpio_header hd; union { @@ -376,7 +376,7 @@ static int cpio_read_oldc_head(struct vfs_class *me, struct vfs_s_super *super) #undef HEAD_LENGTH #define HEAD_LENGTH (110) -static int cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super) +static ssize_t cpio_read_crc_head(struct vfs_class *me, struct vfs_s_super *super) { struct new_cpio_header hd; union { @@ -630,7 +630,7 @@ cpio_super_same (struct vfs_class *me, struct vfs_s_super *parc, return 1; } -static int cpio_read(void *fh, char *buffer, int count) +static ssize_t cpio_read(void *fh, char *buffer, int count) { off_t begin = FH->ino->data_offset; int fd = FH_SUPER->u.arch.fd; From d362e3b0151d9acc87096762da39bf1d0edd9b33 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT service" Date: Sat, 24 Jan 2009 04:38:30 +0100 Subject: [PATCH 2/2] some type fixes in vfs.c -> result types of mc_read() and mc_write() now ssize_t instead of int --- vfs/vfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vfs/vfs.c b/vfs/vfs.c index 21b5404a3..f9e7da707 100644 --- a/vfs/vfs.c +++ b/vfs/vfs.c @@ -377,7 +377,7 @@ MC_NAMEOP (mknod, (const char *path, mode_t mode, dev_t dev), (vfs, mpath, mode, #define MC_HANDLEOP(name, inarg, callarg) \ -int mc_##name inarg \ +ssize_t mc_##name inarg \ { \ struct vfs_class *vfs; \ int result; \ @@ -390,8 +390,8 @@ int mc_##name inarg \ return result; \ } -MC_HANDLEOP(read, (int handle, void *buffer, int count), (vfs_info (handle), buffer, count) ) -MC_HANDLEOP (write, (int handle, const void *buf, int nbyte), (vfs_info (handle), buf, nbyte)) +MC_HANDLEOP(read, (int handle, void *buffer, int count), (vfs_info (handle), buffer, count)) +MC_HANDLEOP(write, (int handle, const void *buf, int nbyte), (vfs_info (handle), buf, nbyte)) #define MC_RENAMEOP(name) \