diff src/file.c @ 32:96af12a50fdb

fix cbc_read
author mir3636
date Tue, 22 Jan 2019 15:48:35 +0900
parents 96a5833d0d82
children 7a63dacab7f8
line wrap: on
line diff
--- a/src/file.c	Fri Jan 18 18:20:02 2019 +0900
+++ b/src/file.c	Tue Jan 22 15:48:35 2019 +0900
@@ -8,6 +8,7 @@
 #include "fs.h"
 #include "file.h"
 #include "spinlock.h"
+#include "proc.h"
 
 struct devsw devsw[NDEV];
 struct cbc_devsw cbc_devsw[NDEV];
@@ -100,7 +101,7 @@
     return -1;
 }
 
-__code cbc_fileread1 (int r, struct file *f, char *addr, int n, __code (*next)(int ret))
+__code cbc_fileread1 (int r, struct file *f, __code (*next)(int ret))
 {
     if (r > 0)
         f->off += r;
@@ -110,8 +111,6 @@
 
 __code cbc_fileread (struct file *f, char *addr, int n, __code (*next)(int ret))
 {
-    int r;
-
     if (f->readable == 0) {
         goto next(-1);
     }
@@ -123,7 +122,6 @@
 
     if (f->type == FD_INODE) {
         ilock(f->ip);
-
         goto cbc_readi(f->ip, addr, f->off, n, f, next);
     }