Date: Wed, 2 Dec 2020 10:01:59 -0800 From: Gleb Smirnoff <glebius@freebsd.org> To: Kyle Evans <kevans@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r368197 - head/sbin/bectl Message-ID: <20201202180159.GC69850@FreeBSD.org> In-Reply-To: <CACNAnaEMtsNRgHPM1pRm9RJzf3ex9w8qNHjLg8gjm%2B8nJ2F0zg@mail.gmail.com> References: <202011302105.0AUL5VHd035423@repo.freebsd.org> <CACNAnaEMtsNRgHPM1pRm9RJzf3ex9w8qNHjLg8gjm%2B8nJ2F0zg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201202180159.GC69850>