diff src/console.c @ 34:a7144583914c

fix
author mir3636
date Thu, 14 Feb 2019 23:33:57 +0900
parents 7a63dacab7f8
children
line wrap: on
line diff
--- a/src/console.c	Tue Jan 22 17:32:06 2019 +0900
+++ b/src/console.c	Thu Feb 14 23:33:57 2019 +0900
@@ -289,15 +289,7 @@
     release(&input.lock);
     ilock(ip);
 
-    //int r = target - n;
-
-    //if (r > 0)
-    //    f->off += r;
-    //iunlock(f->ip);
-
     goto next(target - n);
-
-    //goto next(r);
 }
 
 __code cbc_consoleread (struct inode *ip, char *dst, int n, __code(*next)(int ret))
@@ -312,20 +304,12 @@
     if (n > 0) {
         proc->cbc_arg.cbc_console_arg.n = n;
         proc->cbc_arg.cbc_console_arg.target = target;
-	proc->cbc_arg.cbc_console_arg.dst = dst;
-	proc->cbc_arg.cbc_console_arg.ip = ip;
-	proc->cbc_arg.cbc_console_arg.next = next;
-        if (input.r == input.w) {
-            if (proc->killed) {
-                release(&input.lock);
-                ilock(ip);
-                goto next(-1);
-            }
-
-            goto cbc_sleep(&input.r, &input.lock, cbc_consoleread2);
-        }
+    	proc->cbc_arg.cbc_console_arg.dst = dst;
+	    proc->cbc_arg.cbc_console_arg.ip = ip;
+	    proc->cbc_arg.cbc_console_arg.next = next;
+        goto cbc_consoleread2();    
+    }
 	goto cbc_consoleread1();
-    }
 }
 
 int consoleread (struct inode *ip, char *dst, int n)