Fix file reading

This commit is contained in:
Sebastian Messmer 2014-11-11 00:18:24 +01:00
parent f86db75948
commit bfd7d20c8b

View File

@ -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); //printf("read(%s, _, %zu, %zu, _)\n", path.c_str(), size, offset);
UNUSED(path); UNUSED(path);
try { try {
_device->read(fileinfo->fh, buf, size, offset); //printf("Reading from file %d\n", fileinfo->fh);
return 0; //fflush(stdout);
return _device->read(fileinfo->fh, buf, size, offset);
} catch (CryErrnoException &e) { } catch (CryErrnoException &e) {
return -e.getErrno(); return -e.getErrno();
} }
@ -218,7 +219,7 @@ int CryFuse::write(const path &path, const char *buf, size_t size, off_t offset,
UNUSED(path); UNUSED(path);
try { try {
_device->write(fileinfo->fh, buf, size, offset); _device->write(fileinfo->fh, buf, size, offset);
return 0; return size;
} catch (CryErrnoException &e) { } catch (CryErrnoException &e) {
return -e.getErrno(); return -e.getErrno();
} }