Re: [PATCH v5] printf: add support for printing symbolic error names
From: Andy Shevchenko
Date: Wed Oct 16 2019 - 09:49:54 EST
On Tue, Oct 15, 2019 at 10:07 PM Rasmus Villemoes
<linux@xxxxxxxxxxxxxxxxxx> wrote:
> +const char *errname(int err)
> +{
> + const char *name = __errname(err > 0 ? err : -err);
Looks like mine comment left unseen.
What about to simple use abs(err) here?
> + if (!name)
> + return NULL;
> +
> + return err > 0 ? name + 1 : name;
> +}
--
With Best Regards,
Andy Shevchenko