# HG changeset patch # User anatofuz # Date 1576386927 -32400 # Node ID fd166dda4361d677f464db7f17fddc05a8690381 # Parent 6c81e02e323f5fa0c4a30e134c8d93ad3bb34940 tweak return value at file_read.cbc diff -r 6c81e02e323f -r fd166dda4361 src/file_read.cbc --- a/src/file_read.cbc Sun Dec 15 13:57:57 2019 +0900 +++ b/src/file_read.cbc Sun Dec 15 14:15:27 2019 +0900 @@ -25,16 +25,15 @@ } SysRead* createFileReadInstFromFile(struct Context* cbc_context, struct file* f,char* addr, int n) { - SysRead* self; if (f->type == FD_PIPE) { - self = create_piperead(cbc_context, f->pipe, addr, n, next); + return create_piperead(cbc_context, f->pipe, addr, n, next); } if (f->type == FD_INODE) { ilock(f->ip); - self = create_readi(cbc_context, f->ip, addr, f->off, n, cbc_fileread1); + return create_readi(cbc_context, f->ip, addr, f->off, n, cbc_fileread1); } - return self; + return NULL; //Error? } @@ -57,7 +56,7 @@ goto next(-1); } SysRead* read = createFileReadInstFromFile(proc->cbc_context, f); - read->read(f,addr,n); + goto read->read(f,addr,n); } __code nextFileRead(...) {