gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: realpath can set errno on success


From: Jerry James
Subject: Re: realpath can set errno on success
Date: Mon, 18 Jan 2021 20:40:09 -0700

On Mon, Jan 18, 2021 at 2:10 PM Jerry James <loganjerry@gmail.com> wrote:
> We recently had a build failure on Fedora that was traced back to
> realpath() returning non-NULL AND setting errno to EINVAL.  The glibc
> maintainers say:
>
> "In general, POSIX specifies that errno only has a valid value after
> an unsuccessful function call. glibc follows this policy."
>
> In particular, the mbin() function added by the Version_2_6_13pre70
> patch wraps massert() around a call to realpath().  Instead, the code
> should check that realpath returns a non-NULL value.

I had to change several other massert() calls, all made to functions
that do not guarantee they set errno.  With the attached patch, the
build passes with the latest glibc.  Regards,
-- 
Jerry James
http://www.jamezone.org/

Attachment: gcl-2.6.12-massert.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]