Reviewed-by: Jacob Keller <jacob.e.kel...@intel.com>

On 5/16/2020 8:03 AM, Richard Cochran wrote:
> The transport layer's functional interface foresees having error codes
> percolate back up to the caller.  However, up until now, the uds module
> simply returned -1 for any error.  This patch lets the code return the
> specific error instead.  In addition, it removes the gratuitous printing
> of the error message, leaving that task up to caller, just like the other
> transport modules.
> 
> Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
> ---
>  uds.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/uds.c b/uds.c
> index a4c856b..641a672 100644
> --- a/uds.c
> +++ b/uds.c
> @@ -119,8 +119,8 @@ static int uds_send(struct transport *t, struct fdarray 
> *fda,
>               addr = &uds->address;
>  
>       cnt = sendto(fd, buf, buflen, 0, &addr->sa, addr->len);
> -     if (cnt <= 0 && errno != ECONNREFUSED) {
> -             pr_err("uds: sendto failed: %m");
> +     if (cnt < 1) {
> +             return -errno;
>       }
>       return cnt;


This felt like a bigger functional change, but looking carefully: cnt
would be either 0 or -1 and already indicate an error. Removing this
print makes sense.

Ok.


>  }
> @@ -144,4 +144,3 @@ struct transport *uds_transport_create(void)
>       uds->t.release = uds_release;
>       return &uds->t;
>  }
> -
> 


_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to