[PATCH 15/25] lib: Implement error properly even when not HAVE_ERR_H

Mark Wielaard mark@klomp.org
Tue Dec 20 15:10:27 GMT 2022


Hi,

On Sat, 2022-12-17 at 05:50 +0800, 罗勇刚(Yonggang Luo) wrote:
> On Mon, Dec 12, 2022 at 11:37 PM Mark Wielaard <mark@klomp.org>
> wrote:
> > On Fri, 2022-10-21 at 02:25 +0800, Yonggang Luo via Elfutils-devel
> > wrote:
> > > on win32, there is no err.h
> > > [...]
> > > +#else
> > > +  (void)status;
> > > +  vfprintf(stderr, format, argp);
> > > +#endif
> > >    va_end(argp);
> > 
> > That doesn't look like a valid implementation of error, it ignores
> > errno and doesn't exit when necessary.
> 
> Do you mean it should  call `exit(status)` after the  error message
> is
> printed?

Yes, if status != 0. Also errno should be printed (as a string).

Cheers,

Mark


More information about the Elfutils-devel mailing list