[systemd-devel] [PATCH] networkd: fix reporting errors from hostnamed

Tom Gundersen teg at jklm.no
Tue Jul 29 13:25:59 PDT 2014


On Tue, Jul 22, 2014 at 1:23 AM, Michael Marineau
<michael.marineau at coreos.com> wrote:
> The return value may be -EINVAL or a positive errno from the dbus
> message. Check both ranges, otherwise most errors are silently ignored.

Applied. Thanks!

-t

> ---
>  src/network/networkd-link.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
> index 7a0f30b..be879fd 100644
> --- a/src/network/networkd-link.c
> +++ b/src/network/networkd-link.c
> @@ -845,7 +845,9 @@ static int set_hostname_handler(sd_bus *bus, sd_bus_message *m, void *userdata,
>
>          r = sd_bus_message_get_errno(m);
>          if (r < 0)
> -                log_warning_link(link, "Could not set hostname: %s", strerror(-r));
> +                r = -r;
> +        if (r > 0)
> +                log_warning_link(link, "Could not set hostname: %s", strerror(r));
>
>          return 1;
>  }
> --
> 1.8.5.5
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list