Re: [PATCH 13/35] multipathd: cli.c: use ESRCH for "command not found"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 10, 2021 at 01:40:58PM +0200, mwilck@xxxxxxxx wrote:
> From: Martin Wilck <mwilck@xxxxxxxx>
> 
> EAGAIN is too generic, and doesn't fit semantically either.
> ESRCH in't used anywhere else in our code.
> 
Reviewed-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx>
> Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
> ---
>  multipathd/cli.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/multipathd/cli.c b/multipathd/cli.c
> index 7020d2b..f8c1dbd 100644
> --- a/multipathd/cli.c
> +++ b/multipathd/cli.c
> @@ -253,7 +253,7 @@ find_key (const char * str)
>   *
>   * returns:
>   * ENOMEM: not enough memory to allocate command
> - * EAGAIN: command not found
> + * ESRCH: command not found
>   * EINVAL: argument missing for command
>   */
>  static int
> @@ -288,7 +288,7 @@ get_cmdvec (char * cmd, vector *v)
>  		}
>  		kw = find_key(buff);
>  		if (!kw) {
> -			r = EAGAIN;
> +			r = ESRCH;
>  			goto out;
>  		}
>  		cmdkw = alloc_key();
> @@ -378,7 +378,7 @@ do_genhelp(struct strbuf *reply, const char *cmd, int error) {
>  	case ENOMEM:
>  		rc = print_strbuf(reply, "%s: Not enough memory\n", cmd);
>  		break;
> -	case EAGAIN:
> +	case ESRCH:
>  		rc = print_strbuf(reply, "%s: not found\n", cmd);
>  		break;
>  	case EINVAL:
> -- 
> 2.33.0

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/dm-devel




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux