This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: A patch for NSS to reduce the library code size.
On Fri, Dec 08, 2000 at 02:41:29PM -0800, Ulrich Drepper wrote:
> "H . J . Lu" <hjl@valinux.com> writes:
>
> > I don't know how people feel about the library size. This patch reduces
> > the library code size by about 4k on ia32. Basically, it turns the
> > templates into generic functions.
>
> This is no bad idea and I've made this change. But your patch was
> broken. By simple inspection it should have been able to see. This
> is no race, be more careful. Otherwise things like this will stay in
> my inbox for ages if I cannot find the time to review and fix the code
> myself.
>
Thanks for catching that. Here is a little clean up.
--
H.J. Lu (hjl@valinux.com)
---
2000-12-08 H.J. Lu <hjl@gnu.org>
* nss/getnssent.c (__nss_getent): Clean up.
Index: nss/getnssent.c
===================================================================
RCS file: /work/cvs/gnu/glibc/nss/getnssent.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 getnssent.c
--- nss/getnssent.c 2000/12/09 02:19:24 1.1.1.1
+++ nss/getnssent.c 2000/12/09 02:28:57
@@ -26,7 +26,6 @@ __nss_getent (getent_r_function func, vo
size_t buflen, size_t *buffer_size, int *h_errnop)
{
void *result;
- int save;
if (*buffer == NULL)
{
@@ -44,6 +43,7 @@ __nss_getent (getent_r_function func, vo
new_buf = realloc (*buffer, *buffer_size);
if (new_buf == NULL)
{
+ int save;
/* We are out of memory. Free the current buffer so that the
process gets a chance for a normal termination. */
save = errno;
@@ -55,10 +55,6 @@ __nss_getent (getent_r_function func, vo
if (*buffer == NULL)
result = NULL;
-
- /* Release lock. Preserve error value. */
- save = errno;
- __set_errno (save);
return result;
}