svn commit: r339468 - in head/sys: kern sys
Conrad Meyer
cem at freebsd.org
Sat Oct 20 19:59:57 UTC 2018
Hi Ed,
On Sat, Oct 20, 2018 at 11:54 AM Ed Schouten <ed at nuxi.nl> wrote:
> Op za 20 okt. 2018 om 20:31 schreef Conrad Meyer <cem at freebsd.org>:
> > +static int
> > +sbuf_tty_drain(void *a, const char *d, int len)
> > +{
> > + struct tty *tp;
> > + int rc;
> > +
> > + tp = a;
> > +
> > + if (kdb_active) {
> > + cnputsn(d, len);
> > + return (len);
> > + }
> > + if (tp != NULL && panicstr == NULL) {
> > + rc = tty_putstrn(tp, d, len);
> > + if (rc != 0)
> > + return (-ENXIO);
> > + return (len);
> > + }
> > + return (-ENXIO);
> > +}
>
> Disclaimer: Long time since I did a lot with the TTY code.
>
> Can kdb_active, tp == NULL and panicstr != NULL even occur in this
> case? tty_info() can only get called in non-degenerate cases, right?
I think you are correct, but I did not want to investigate to confirm.
This was just the direct, conservative conversion of ttyprintf ->
putchar. The checks can *probably* be removed.
Best regards,
Conrad
More information about the svn-src-all
mailing list