Fix for 90e2971 that caused some geli commands to return the wrong exit status.
authorKirk McKusick <mckusick@FreeBSD.org>
Fri, 29 Jul 2022 18:11:09 +0000 (11:11 -0700)
committerKirk McKusick <mckusick@FreeBSD.org>
Fri, 29 Jul 2022 18:11:46 +0000 (11:11 -0700)
commit58cb3626762d8ec9c499a664223190648479fc5a
tree3435e884616e5725160d743fc04fbccbf2a6521a
parentb0f73768220e945deebebefc4a2d63ae6a3bfe19
Fix for 90e2971 that caused some geli commands to return the wrong exit status.

The reported problem is that some geli commands exit with a
success status when they should exit with a failed status.

The gctl_error() function is defined differently in the kernel
(in sys/geom/geom_ctl.c) versus in the geom user facilities (in
sbin/geom/misc/subr.c). In the kernel, calling gctl_error() causes
an error return to be set while in the user version it does not.
It was only by a quirk that had been added to the user geom return
processing that I "cleaned up" that the lack of the user implementaion
to set the error return showed up.

This patch adds the missing setting of the error code when calling
the user facility gctl_error().

Reported by:  Jenkins
Debugging by: Alan Somers
Debugging by: Cy Schubert
Debugging by: Li-Wen Hsu
sbin/geom/misc/subr.c