lkml.org 
[lkml]   [2019]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5] printf: add support for printing symbolic error names
On Tue, Oct 15, 2019 at 10:07 PM Rasmus Villemoes
<linux@rasmusvillemoes.dk> 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

\
 
 \ /
  Last update: 2019-10-16 15:50    [W:0.094 / U:2.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site