[systemd-devel] [PATCH 4/5] everywhere: stop using strerror()

Lennart Poettering lennart at poettering.net
Mon Feb 24 07:05:36 PST 2014


On Mon, 24.02.14 15:59, Michal Sekletar (msekleta at redhat.com) wrote:

> ---
>  src/hostname/hostnamed.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
> index 064d9d2..d8938a4 100644
> --- a/src/hostname/hostnamed.c
> +++ b/src/hostname/hostnamed.c
> @@ -409,8 +409,8 @@ static int method_set_hostname(sd_bus *bus, sd_bus_message *m, void *userdata, s
>  
>          r = context_write_data_hostname(c);
>          if (r < 0) {
> -                log_error("Failed to set host name: %s", strerror(-r));
> -                return sd_bus_error_set_errnof(error, r, "Failed to set hostname: %s", strerror(-r));
> +                log_error("Failed to set host name: %m");
> +                return sd_bus_error_set_errnof(error, r, "Failed to
>          set hostname: %m");

Hmm? %m is equivalent to strerror(errno), not to strerror(-r)...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list