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
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 {
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);