mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
zed: _zed_conf_display_help(): be consistent about what got_err means
Users passed in EXIT_SUCCESS and EXIT_FAILURE, despite it being a bool Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11860
This commit is contained in:
parent
d622f16b6b
commit
88bf37d91a
@ -126,7 +126,7 @@ zed_conf_destroy(struct zed_conf *zcp)
|
|||||||
* otherwise, output to stderr and exit with a failure status.
|
* otherwise, output to stderr and exit with a failure status.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
_zed_conf_display_help(const char *prog, int got_err)
|
_zed_conf_display_help(const char *prog, boolean_t got_err)
|
||||||
{
|
{
|
||||||
struct opt { const char *o, *d, *v; };
|
struct opt { const char *o, *d, *v; };
|
||||||
|
|
||||||
@ -257,7 +257,7 @@ zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv)
|
|||||||
while ((opt = getopt(argc, argv, opts)) != -1) {
|
while ((opt = getopt(argc, argv, opts)) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'h':
|
case 'h':
|
||||||
_zed_conf_display_help(argv[0], EXIT_SUCCESS);
|
_zed_conf_display_help(argv[0], B_FALSE);
|
||||||
break;
|
break;
|
||||||
case 'L':
|
case 'L':
|
||||||
_zed_conf_display_license();
|
_zed_conf_display_license();
|
||||||
@ -309,11 +309,11 @@ zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv)
|
|||||||
case '?':
|
case '?':
|
||||||
default:
|
default:
|
||||||
if (optopt == '?')
|
if (optopt == '?')
|
||||||
_zed_conf_display_help(argv[0], EXIT_SUCCESS);
|
_zed_conf_display_help(argv[0], B_FALSE);
|
||||||
|
|
||||||
fprintf(stderr, "%s: Invalid option '-%c'\n\n",
|
fprintf(stderr, "%s: Invalid option '-%c'\n\n",
|
||||||
argv[0], optopt);
|
argv[0], optopt);
|
||||||
_zed_conf_display_help(argv[0], EXIT_FAILURE);
|
_zed_conf_display_help(argv[0], B_TRUE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user