From: David van Moolenbroek Date: Tue, 1 Oct 2013 21:25:01 +0000 (+0200) Subject: TTY: skip /dev/log checks if console is serial X-Git-Tag: v3.3.0~578 X-Git-Url: http://zhaoyanbai.com/repos/?a=commitdiff_plain;h=5e48dc3f40c3cf2b6ad3dfce1b2a6c45f0e3ed2a;p=minix.git TTY: skip /dev/log checks if console is serial It is unclear why /dev/log has its own open/close rules, but those rules conflict with serial console redirection. This does not solve the root of the problem, but it puts back in place more or less the same workaround that was already in place before the TTY overhaul. Change-Id: Ib53abbc28a76c1f2b0befc8448aeed0173bc96a5 --- diff --git a/drivers/tty/tty.c b/drivers/tty/tty.c index e1f55dad0..5bcc05b7f 100644 --- a/drivers/tty/tty.c +++ b/drivers/tty/tty.c @@ -780,7 +780,7 @@ static int do_open(devminor_t minor, int access, endpoint_t user_endpt) if ((tp = line2tty(minor)) == NULL) return ENXIO; - if (minor == LOG_MINOR) { + if (minor == LOG_MINOR && isconsole(tp)) { /* The log device is a write-only diagnostics device. */ if (access & R_BIT) return EACCES; } else { @@ -809,7 +809,7 @@ static int do_close(devminor_t minor) if ((tp = line2tty(minor)) == NULL) return ENXIO; - if (minor != LOG_MINOR && --tp->tty_openct == 0) { + if ((minor != LOG_MINOR || !isconsole(tp)) && --tp->tty_openct == 0) { tp->tty_pgrp = 0; tty_icancel(tp); (*tp->tty_ocancel)(tp, 0);