comparison src/impl/file_impl_none.cbc @ 282:e2b0a3e0c97a

fix file_impl_none.cbc
author menikon <e165723@ie.u-ryukyu.ac.jp>
date Tue, 21 Jan 2020 17:02:11 +0900
parents 9f28b86fecc5
children
comparison
equal deleted inserted replaced
281:648247c08bbd 282:e2b0a3e0c97a
40 goto next(...); 40 goto next(...);
41 } 41 }
42 42
43 __code closenone(struct none* file,int fd, __code next(...)) { 43 __code closenone(struct none* file,int fd, __code next(...)) {
44 44
45 goto next(...); 45 goto file->noneclose(file->file, next);
46 } 46 }
47
48 __code noneclose(struct none* none, struct file* file, __code next(...){
49 struct file ff;
50 acquire(*ftable.loc)
51
52 if (f->ref < 1) {
53 goto cbc_context->kernel_error->panic("file close");
54 }
55 goto pipe->cbc_noneclose2(f,ff,next);
56 }
57
58 __code noneclose2(struct none* none,struct file* file, struct file* ff,__code next(...)){
59 if (--f->ref > 0) {
60 release(&ftable.lock);
61 goto cbc_context->return();
62 }
63 goto pipe->cbc_pipeclose3(f,ff,next);
64 }