From owner-svn-src-head@freebsd.org Sat Oct 20 19:59:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2EDBFF37F9; Sat, 20 Oct 2018 19:59:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it1-f180.google.com (mail-it1-f180.google.com [209.85.166.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 859ED852F6; Sat, 20 Oct 2018 19:59:56 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it1-f180.google.com with SMTP id h6-v6so6727301ith.0; Sat, 20 Oct 2018 12:59:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=GO/iCxzNbm2ztMRuoY1hYZ0SftGSVswoDawVLP9KsDc=; b=cNGyDJsLdWk+bAHCQEuRWKMvk/9iU8PoxY64JJOfPUdHhUpj9rek3kgWWFvZcmIm9q mLqkRWijRFkNWTtvuQvc+3OWhYeRaYafIVLbEUL2Ln3C1NIovHqgGlBhcDnlGpUJXSJ0 6+dRdmtDuIz6mO7YkSiuk9b1oxMSrMEHh2xYS6421WHv23Ganzz+FrBRMtmWvSl3/d5J 8UgEvOLZhgwo1V7mCV9S9eIhs7agtuZ31MlKmeToxO3af9bsNMrdyAXDUCk+MPEc1yej EC4leOOxjmNjE6rIT4xXoL1w9M8GdeHgdo/9TONPkD9QChsIfH8pgEaZYdFH8eawrBVQ kXJA== X-Gm-Message-State: ABuFfoiD/PMAYPCH2A0bxO0MGMH/YQBR9UgpM15Jfnjyr6T0VsbQyPdQ VX6ouShg+SoQPNIHslh+vYzNoVJc X-Google-Smtp-Source: ACcGV61j6h39re6UnPmWIKBTmpe10DHXZ2p1bR5NHpykiaPznL+lxmgxOlF85ouJ88skLDkx74tm5w== X-Received: by 2002:a02:9d28:: with SMTP id n37-v6mr31164852jak.80.1540065588457; Sat, 20 Oct 2018 12:59:48 -0700 (PDT) Received: from mail-it1-f173.google.com (mail-it1-f173.google.com. [209.85.166.173]) by smtp.gmail.com with ESMTPSA id h21-v6sm2893343ith.20.2018.10.20.12.59.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 12:59:48 -0700 (PDT) Received: by mail-it1-f173.google.com with SMTP id i191-v6so8238106iti.5; Sat, 20 Oct 2018 12:59:48 -0700 (PDT) X-Received: by 2002:a24:a089:: with SMTP id o131-v6mr6212582ite.91.1540065587687; Sat, 20 Oct 2018 12:59:47 -0700 (PDT) MIME-Version: 1.0 References: <201810201831.w9KIVbtN043921@repo.freebsd.org> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Sat, 20 Oct 2018 12:59:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r339468 - in head/sys: kern sys To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Oct 2018 19:59:57 -0000 Hi Ed, On Sat, Oct 20, 2018 at 11:54 AM Ed Schouten wrote: > Op za 20 okt. 2018 om 20:31 schreef Conrad Meyer : > > +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