[dm-devel] [PATCH 4/5] multipath-tools: Set errno mpath_recv_reply() when failure

Christophe Varoqui christophe.varoqui at opensvc.com
Fri Feb 10 11:36:42 UTC 2017


Applied.

On Fri, Jan 20, 2017 at 2:39 PM, Gris Ge <fge at redhat.com> wrote:

> Enforce what mpath_cmd.h states "-1 on failure (with errno set)" for
> mpath_recv_reply() by set errno and return -1 on failure.
>
> Signed-off-by: Gris Ge <fge at redhat.com>
> ---
>  libmpathcmd/mpath_cmd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libmpathcmd/mpath_cmd.c b/libmpathcmd/mpath_cmd.c
> index 7fc9e98..856e6b4 100644
> --- a/libmpathcmd/mpath_cmd.c
> +++ b/libmpathcmd/mpath_cmd.c
> @@ -141,7 +141,7 @@ int mpath_recv_reply(int fd, char **reply, unsigned
> int timeout)
>         *reply = NULL;
>         len = mpath_recv_reply_len(fd, timeout);
>         if (len <= 0)
> -               return len;
> +               return -1;
>         *reply = malloc(len);
>         if (!*reply)
>                 return -1;
> @@ -149,7 +149,7 @@ int mpath_recv_reply(int fd, char **reply, unsigned
> int timeout)
>         if (err) {
>                 free(*reply);
>                 *reply = NULL;
> -               return err;
> +               return -1;
>         }
>         return 0;
>  }
> --
> 1.8.3.1
>
> --
> dm-devel mailing list
> dm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20170210/08b61fb1/attachment.htm>


More information about the dm-devel mailing list