[systemd-devel] [PATCH] localed: forward xkbcommon errors

Lennart Poettering lennart at poettering.net
Tue Dec 2 06:49:42 PST 2014


On Tue, 02.12.14 14:02, Jan Synacek (jsynacek at redhat.com) wrote:

> The errors are prefixed with "libxkbcommon", because they are quite
> confusing. With the prefix, we at least know where they come from.
> ---
>  src/locale/localed.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/src/locale/localed.c b/src/locale/localed.c
> index 4e56382..ea54798 100644
> --- a/src/locale/localed.c
> +++ b/src/locale/localed.c
> @@ -1011,10 +1011,16 @@ static int method_set_vc_keyboard(sd_bus *bus, sd_bus_message *m, void *userdata
>  
>  #ifdef HAVE_XKBCOMMON
>  static void log_xkb(struct xkb_context *ctx, enum xkb_log_level lvl, const char *format, va_list args) {
> -        /* suppress xkb messages for now */
> +        _cleanup_free_ char *fmt = NULL;
> +        sd_bus_error *e;
> +
> +        if (asprintf(&fmt, "libxkbcommon: %s", format) < 0)
> +                (void) log_oom();
> +        e = xkb_context_get_user_data(ctx);
> +        bus_error_setfv(e, SD_BUS_ERROR_INVALID_ARGS, fmt, args);

I thought the plan now was to log them at debug level but not return
them to the client?

Also, strappenda()!

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list