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

Benjamin Marzinski bmarzins at redhat.com
Thu Sep 16 00:02:33 UTC 2021


On Fri, Sep 10, 2021 at 01:40:58PM +0200, mwilck at suse.com wrote:
> From: Martin Wilck <mwilck at suse.com>
> 
> EAGAIN is too generic, and doesn't fit semantically either.
> ESRCH in't used anywhere else in our code.
> 
Reviewed-by: Benjamin Marzinski <bmarzins at redhat.com>
> Signed-off-by: Martin Wilck <mwilck at suse.com>
> ---
>  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




More information about the dm-devel mailing list