Re: git: 90e29718cffc - main - Clarify when GEOM utilities exit with success or failure.

From: Alan Somers <asomers_at_freebsd.org>
Date: Sun, 24 Jul 2022 18:26:25 UTC
On Sat, Jul 16, 2022 at 11:27 AM Kirk McKusick <mckusick@freebsd.org> wrote:
>
> The branch main has been updated by mckusick:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=90e29718cffcec987769ccbe39308357202c46d5
>
> commit 90e29718cffcec987769ccbe39308357202c46d5
> Author:     Kirk McKusick <mckusick@FreeBSD.org>
> AuthorDate: 2022-07-16 17:25:22 +0000
> Commit:     Kirk McKusick <mckusick@FreeBSD.org>
> CommitDate: 2022-07-16 17:26:51 +0000
>
>     Clarify when GEOM utilities exit with success or failure.
>
>     Historically, GEOM utilities (gpart(8), gstripe(8), gmirror(8),
>     etc) used the gctl_error() routine to report errors. If they called
>     gctl_error() they would exit with EXIT_FAILURE, otherwise they would
>     return with EXIT_SUCCESS. If they used gctl_error() to output an
>     informational message, for example when run with the -v (verbose)
>     option, they would mistakenly exit with EXIT_FAILURE. A further
>     limitation of the gctl_error() function was that it could only be
>     called once. Messages from any additional calls to gctl_error()
>     would be silently discarded.
>
>     To resolve these problems a new function, gctl_msg() has been added.
>     It can be called multiple times to output multiple messages. It
>     also has an additional errno argument which should be zero if it is
>     an informational message or an errno value (EINVAL, EBUSY, etc) if
>     it is an error. When done the gctl_post_messages() function should
>     be called to indicate that all messages have been posted. If any
>     of the messages had a non-zero errno, the utility will EXIT_FAILURE.
>     If only informational messages (with zero errno) were posted, the
>     utility will EXIT_SUCCESS.
>
>     Tested by:   Peter Holm
>     PR:          265184
>     MFC after:   1 week
> ---
>  lib/libgeom/geom_ctl.c   |  6 ++--
>  sbin/geom/core/geom.c    |  5 +++-
>  sys/geom/geom.h          |  2 +-
>  sys/geom/geom_ctl.c      | 10 ++++++-
>  sys/geom/union/g_union.c | 75 ++++++++++++++++++++++++++----------------------
>  5 files changed, 57 insertions(+), 41 deletions(-)

This change is causing a bunch of ATF tests to fail.  I'm not sure if
you broke something or if the tests just need to be updated because
geli returns better error codes.  In either case, could you please
investigate?
https://ci.freebsd.org/job/FreeBSD-main-amd64-test/21633/

-Alan