From b8fdac7be975f58362a035cdc9c5687c6c287bba Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Fri, 25 Jan 2013 19:42:52 +0000 Subject: Pull fix for exFAT from original source http://code.google.com/p/exfat/source/detail?r=336 Change-Id: Ie8453770a4dcb31283012550f28483ad88bdc267 --- exfat/exfat-fuse/main.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'exfat/exfat-fuse') diff --git a/exfat/exfat-fuse/main.c b/exfat/exfat-fuse/main.c index 6771096f3..e50c14a74 100644 --- a/exfat/exfat-fuse/main.c +++ b/exfat/exfat-fuse/main.c @@ -154,19 +154,25 @@ static int fuse_exfat_release(const char* path, struct fuse_file_info* fi) static int fuse_exfat_read(const char* path, char* buffer, size_t size, off64_t offset, struct fuse_file_info* fi) { + ssize_t ret; + exfat_debug("[%s] %s (%zu bytes)", __func__, path, size); - if (exfat_generic_pread(&ef, get_node(fi), buffer, size, offset) != size) - return EOF; - return size; + ret = exfat_generic_pread(&ef, get_node(fi), buffer, size, offset); + if (ret < 0) + return -EIO; + return ret; } static int fuse_exfat_write(const char* path, const char* buffer, size_t size, off64_t offset, struct fuse_file_info* fi) { + ssize_t ret; + exfat_debug("[%s] %s (%zu bytes)", __func__, path, size); - if (exfat_generic_pwrite(&ef, get_node(fi), buffer, size, offset) != size) - return EOF; - return size; + ret = exfat_generic_pwrite(&ef, get_node(fi), buffer, size, offset); + if (ret < 0) + return -EIO; + return ret; } static int fuse_exfat_unlink(const char* path) -- cgit v1.2.3