changeset 169:e0255e66e646

...
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Thu, 16 Jan 2020 16:20:19 +0900
parents 04a5e0aa7f01
children 9b0f4b421288
files src/impl/file_impl_pipe.cbc src/interface/file.dg
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/impl/file_impl_pipe.cbc	Thu Jan 16 16:10:00 2020 +0900
+++ b/src/impl/file_impl_pipe.cbc	Thu Jan 16 16:20:19 2020 +0900
@@ -84,8 +84,12 @@
   goto next(...);
 }
 
-__code closepipe(struct pipe* file,__code next(...)) {
-
-  goto next(...);
+__code closepipe(struct pipe* file,int fd,__code next(...)) {
+  proc->ofile[fd] = 0;
+  goto cbc_fileclose(f,next);
 }
 
+
+__code cbc_fileclose(struct file* file, __code next(...)) {
+  goto next();
+}
--- a/src/interface/file.dg	Thu Jan 16 16:10:00 2020 +0900
+++ b/src/interface/file.dg	Thu Jan 16 16:20:19 2020 +0900
@@ -7,8 +7,9 @@
     struct stat* st;
     char* addr;
     int n;
+    int fd;
     __code stat(Impl* file, struct stat* st, __code next(...));
     __code read(Impl* file, char* addr, __code next(...));
     __code write(Impl* file, char* addr, int n, __code next(...));
-    __code close(Impl* file,__code next(...));
+    __code close(Impl* file,int fd, __code next(...));
 } file;