From bfd7d20c8b1581814886b4a8cda1bc41ec877c92 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Tue, 11 Nov 2014 00:18:24 +0100 Subject: [PATCH] Fix file reading --- src/CryFuse.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/CryFuse.cpp b/src/CryFuse.cpp index 65447269..7188fa16 100644 --- a/src/CryFuse.cpp +++ b/src/CryFuse.cpp @@ -206,8 +206,9 @@ int CryFuse::read(const path &path, char *buf, size_t size, off_t offset, fuse_f //printf("read(%s, _, %zu, %zu, _)\n", path.c_str(), size, offset); UNUSED(path); try { - _device->read(fileinfo->fh, buf, size, offset); - return 0; + //printf("Reading from file %d\n", fileinfo->fh); + //fflush(stdout); + return _device->read(fileinfo->fh, buf, size, offset); } catch (CryErrnoException &e) { return -e.getErrno(); } @@ -218,7 +219,7 @@ int CryFuse::write(const path &path, const char *buf, size_t size, off_t offset, UNUSED(path); try { _device->write(fileinfo->fh, buf, size, offset); - return 0; + return size; } catch (CryErrnoException &e) { return -e.getErrno(); }