[systemd-devel] [PATCH] sd-dhcp-client: log positive error number

Tom Gundersen teg at jklm.no
Sun Apr 13 04:16:30 PDT 2014


Hm, why? Are not error messages more useful?
On 13 Apr 2014 12:53, "Umut Tezduyar Lindskog" <umut.tezduyar at axis.com>
wrote:

> Log error no for such client_stop(client, DHCP_EVENT_STOP)
> ---
>  src/libsystemd-network/sd-dhcp-client.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/libsystemd-network/sd-dhcp-client.c
> b/src/libsystemd-network/sd-dhcp-client.c
> index 4892203..9715953 100644
> --- a/src/libsystemd-network/sd-dhcp-client.c
> +++ b/src/libsystemd-network/sd-dhcp-client.c
> @@ -230,7 +230,10 @@ static int client_initialize(sd_dhcp_client *client) {
>  static sd_dhcp_client *client_stop(sd_dhcp_client *client, int error) {
>          assert_return(client, NULL);
>
> -        log_dhcp_client(client, "STOPPED: %s", strerror(-error));
> +        if (error < 0)
> +                log_dhcp_client(client, "STOPPED: %s", strerror(-error));
> +        else
> +                log_dhcp_client(client, "STOPPED: %d", error);
>
>          client = client_notify(client, error);
>
> --
> 1.7.10.4
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20140413/c25203e3/attachment.html>


More information about the systemd-devel mailing list