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

Lennart Poettering lennart at poettering.net
Sun Nov 30 15:56:59 PST 2014


On Tue, 25.11.14 09:23, Jan Synacek (jsynacek at redhat.com) wrote:

>  #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();

Looks like a candidate for "strappenda()"

> +        e = xkb_context_get_user_data(ctx);
> +        bus_error_setfv(e, SD_BUS_ERROR_INVALID_ARGS, fmt, args);
>  }
>  

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list