From owner-svn-src-all@freebsd.org Wed Dec 2 18:02:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5A644A283A; Wed, 2 Dec 2020 18:02:07 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CmRcv27nPz3NDT; Wed, 2 Dec 2020 18:02:06 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 0B2I1xf2081878 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 2 Dec 2020 10:01:59 -0800 (PST) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 0B2I1xwJ081877; Wed, 2 Dec 2020 10:01:59 -0800 (PST) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Wed, 2 Dec 2020 10:01:59 -0800 From: Gleb Smirnoff To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r368197 - head/sbin/bectl Message-ID: <20201202180159.GC69850@FreeBSD.org> References: <202011302105.0AUL5VHd035423@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4CmRcv27nPz3NDT X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Dec 2020 18:02:07 -0000 Kyle, On Mon, Nov 30, 2020 at 08:28:58PM -0600, Kyle Evans wrote: K> > Log: K> > Print at least something when failing. K> > K> > Modified: K> > head/sbin/bectl/bectl.c K> > K> > Modified: head/sbin/bectl/bectl.c K> > ============================================================================== K> > --- head/sbin/bectl/bectl.c Mon Nov 30 20:58:42 2020 (r368196) K> > +++ head/sbin/bectl/bectl.c Mon Nov 30 21:05:31 2020 (r368197) K> > @@ -584,8 +584,11 @@ main(int argc, char *argv[]) K> > return (usage(false)); K> > } K> > K> > - if ((be = libbe_init(root)) == NULL) K> > + if ((be = libbe_init(root)) == NULL) { K> > + fprintf(stderr, "libbe_init(\"%s\") failed.\n", K> > + root != NULL ? root : ""); K> > return (-1); K> > + } K> > K> > libbe_print_on_error(be, !cmd->silent); K> > K> K> This should be gated on !cmd->silent, because some paths have K> consumers that are specifically designed to not have to deal with K> redirecting stderr. It was quite intentional that this didn't K> previously print anything. AFAIK, the only command that has cmd->silent is "check". I can't agree that it should suppress stderr in case of libbe_init() failure. Failure of the library is something different to failed check of current system. It is permanent failure, meaning that command is being with incorrect root argument or ZFS is missing at all. Pretty much the same as using bectl with incorrect arguments or options. -- Gleb Smirnoff