summaryrefslogtreecommitdiffstats
path: root/exfat/exfat-fuse/main.c
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2013-01-28 16:22:05 +0100
committerGerrit Code Review <gerrit@5.9.244.119>2013-01-28 16:22:05 +0100
commitaa9dba396163d46711d5bcddee5105ce487b121e (patch)
treea349f63ee2d7ec2deedb2c29f88dee1403e2dd9b /exfat/exfat-fuse/main.c
parentReset progress bar in ORS (diff)
parentPull fix for exFAT from original source (diff)
downloadandroid_bootable_recovery-aa9dba396163d46711d5bcddee5105ce487b121e.tar
android_bootable_recovery-aa9dba396163d46711d5bcddee5105ce487b121e.tar.gz
android_bootable_recovery-aa9dba396163d46711d5bcddee5105ce487b121e.tar.bz2
android_bootable_recovery-aa9dba396163d46711d5bcddee5105ce487b121e.tar.lz
android_bootable_recovery-aa9dba396163d46711d5bcddee5105ce487b121e.tar.xz
android_bootable_recovery-aa9dba396163d46711d5bcddee5105ce487b121e.tar.zst
android_bootable_recovery-aa9dba396163d46711d5bcddee5105ce487b121e.zip
Diffstat (limited to 'exfat/exfat-fuse/main.c')
-rw-r--r--exfat/exfat-fuse/main.c18
1 files changed, 12 insertions, 6 deletions
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)