This is the mail archive of the
libc-alpha@cygnus.com
mailing list for the glibc project.
libc-19980601: spurious use of __errno_location
- To: GNU Libc Alpha Testers <libc-alpha@cygnus.com>
- Subject: libc-19980601: spurious use of __errno_location
- From: Gordon Matzigkeit <gord@m-tech.ab.ca>
- Date: 01 Jun 1998 23:32:12 -0600
- cc: Hurd Bug List <bug-hurd@gnu.org>
Hi!
In several places in glibc, __errno_location is used directly.
Unfortunately, this doesn't work on the Hurd, which defines
__hurd_errno_location.
The common situation is that people want a pointer to errno, so they
use:
__errno_location ()
However, it seems to me that:
&errno
which expands to:
&(*__errno_location ()) == __errno_location () /* Linux */
/* &(*__hurd_errno_location ()) on the Hurd */
is just as good, and is also portable to the Hurd.
The attached patch changes all instances of `__errno_location ()' to
`&errno'.
1998-06-01 Gordon Matzigkeit <gord@profitpress.com>
* grp/fgetgrent_r.c: Use &errno instead of __errno_location ().
* inet/getnetgrent_r.c: Likewise.
* nss/getXXbyYY_r.c: Likewise.
* nss/getXXent_r.c: Likewise.
* pwd/fgetpwent_r.c: Likewise.
* shadow/sgetspent_r.c: Likewise.
* shadow/fgetspent_r.c: Likewise.
* sunrpc/publickey.c: Likewise.
Thanks,
--
Gordon Matzigkeit \ Proudly running pieces of the GNU operating system.
gord@profitpress.com \ Jacques Cousteau loved programming in assembler.
libc-19980601-errno.diff