[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
realpath can set errno on success
From: |
Jerry James |
Subject: |
realpath can set errno on success |
Date: |
Mon, 18 Jan 2021 14:10:03 -0700 |
Hi Camm,
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.
Regards,
--
Jerry James
http://www.jamezone.org/
- realpath can set errno on success,
Jerry James <=