]> Zhao Yanbai Git Server - minix.git/commitdiff
tty: handle REVIVE case on console device
authorBen Gras <ben@minix3.org>
Tue, 9 Aug 2011 16:59:01 +0000 (16:59 +0000)
committerBen Gras <ben@minix3.org>
Tue, 9 Aug 2011 16:59:01 +0000 (16:59 +0000)
. can happen on e.g. ^S
. reported by Stephen Hatton

drivers/tty/console.c

index 230f26fac12525e119b61a320269d3ec46720a4b..58d062d39b5b7b9607d2c445092313175c2b900d 100644 (file)
@@ -206,10 +206,14 @@ int try;
 
   /* Reply to the writer if all output is finished or if an error occured. */
   if (tp->tty_outleft == 0 || result != OK) {
-       /* REVIVE is not possible. I/O on memory mapped consoles finishes. */
-       tty_reply(tp->tty_outrepcode, tp->tty_outcaller, tp->tty_outproc,
-                                                       tp->tty_outcum);
-       tp->tty_outcum = 0;
+       if(tp->tty_outrepcode == TTY_REVIVE) {
+               notify(tp->tty_outcaller);
+               tp->tty_outrevived = 1;
+       } else {
+               tty_reply(tp->tty_outrepcode, tp->tty_outcaller,
+                       tp->tty_outproc, tp->tty_outcum);
+               tp->tty_outcum = 0;
+       }
   }
 
   return 0;