]> Zhao Yanbai Git Server - minix.git/commitdiff
TTY: do not reply to KERNEL
authorDavid van Moolenbroek <david@minix3.org>
Tue, 25 Feb 2014 13:44:58 +0000 (14:44 +0100)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:13 +0000 (17:05 +0200)
Diagnostics messages are printed using locally generated requests,
using KERNEL as the calling endpoint.  No reply should be sent for
such cases.  This check was accidentally lost with the previous
removal of tty_reply().

Change-Id: I4b76215a4d90e927b0071675d89d861aa399abb3

drivers/tty/arch/earm/rs232.c
drivers/tty/arch/i386/console.c
drivers/tty/arch/i386/rs232.c

index 13d817591021a9446d9ab93eb154c54007dee063..f9a9e8777e1d81de16c2531c985bab43bbf63221 100644 (file)
@@ -266,8 +266,9 @@ rs_write(register tty_t *tp, int try)
                tp->tty_outcum += count;
                if ((tp->tty_outleft -= count) == 0) {
                        /* Output is finished, reply to the writer. */
-                       chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
-                               tp->tty_outcum);
+                       if (tp->tty_outcaller != KERNEL)
+                               chardriver_reply_task(tp->tty_outcaller,
+                                       tp->tty_outid, tp->tty_outcum);
                        tp->tty_outcum = 0;
                        tp->tty_outcaller = NONE;
                }
@@ -275,7 +276,9 @@ rs_write(register tty_t *tp, int try)
        }
        if (tp->tty_outleft > 0 && tp->tty_termios.c_ospeed == B0) {
                /* Oops, the line has hung up. */
-               chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO);
+               if (tp->tty_outcaller != KERNEL)
+                       chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
+                               EIO);
                tp->tty_outleft = tp->tty_outcum = 0;
                tp->tty_outcaller = NONE;
        }
index efb49e852c36e6b3ccff311ebf1a33b24f305448..27d95db5b196b138c42ee7da314748222a84d42a 100644 (file)
@@ -223,10 +223,11 @@ int try;
 
   flush(cons);                 /* transfer anything buffered to the screen */
 
-  /* Reply to the writer if all output is finished or if an error occured. */
+  /* Reply to the writer if all output is finished or if an error occurred. */
   if (tp->tty_outleft == 0 || result != OK) {
-       chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
-               result != OK ? result : tp->tty_outcum);
+       if (tp->tty_outcaller != KERNEL)
+               chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
+                       result != OK ? result : tp->tty_outcum);
        tp->tty_outcum = tp->tty_outleft = 0;
        tp->tty_outcaller = NONE;
   }
index d98979d3dca3a38e0783c23666ef3ab06a6dc1df..0e29628e38501265424fdfd3c6fbc5d57237c97d 100644 (file)
@@ -274,15 +274,17 @@ static int rs_write(register tty_t *tp, int try)
        tp->tty_outcum += count;
        if ((tp->tty_outleft -= count) == 0) {
                /* Output is finished, reply to the writer. */
-               chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
-                       tp->tty_outcum);
+               if (tp->tty_outcaller != KERNEL)
+                       chardriver_reply_task(tp->tty_outcaller, tp->tty_outid,
+                               tp->tty_outcum);
                tp->tty_outcum = 0;
                tp->tty_outcaller = NONE;
        }
   }
   if (tp->tty_outleft > 0 && tp->tty_termios.c_ospeed == B0) {
        /* Oops, the line has hung up. */
-       chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO);
+       if (tp->tty_outcaller != KERNEL)
+               chardriver_reply_task(tp->tty_outcaller, tp->tty_outid, EIO);
        tp->tty_outleft = tp->tty_outcum = 0;
        tp->tty_outcaller = NONE;
   }