make changes configurable through io_semantics()
This commit is contained in:
parent
7ba5b0d150
commit
5bd7fc86c3
2 changed files with 22 additions and 2 deletions
|
@ -1098,9 +1098,20 @@ cfs_read(int fd, void *buf, unsigned size)
|
|||
|
||||
fdp = &coffee_fd_set[fd];
|
||||
file = fdp->file;
|
||||
while(fdp->offset + size > file->end) {
|
||||
((char*)buf)[--size] = 0;
|
||||
|
||||
#if COFFEE_IO_SEMANTICS
|
||||
if(fdp->io_flags & CFS_COFFEE_IO_FIRM_SIZE) {
|
||||
while(fdp->offset + size > file->end) {
|
||||
((char*)buf)[--size] = 0;
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
if(fdp->offset + size > file->end) {
|
||||
size = file->end - fdp->offset;
|
||||
}
|
||||
#if COFFEE_IO_SEMANTICS
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If the file is not modified, read directly from the file extent. */
|
||||
if(!FILE_MODIFIED(file)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue