This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[COMMITTED PATCH] more cruft patrol
- From: Roland McGrath <roland at hack dot frob dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 31 Jul 2012 10:02:49 -0700 (PDT)
- Subject: [COMMITTED PATCH] more cruft patrol
This is actually three separate commits.
Again, makes no difference to the x86_64-linux-gnu build.
Thanks,
Roland
2012-07-31 Roland McGrath <roland@hack.frob.com>
* include/sys/socket.h (__libc_accept, __libc_accept4):
Add attribute_hidden.
* socket/accept4.c (__libc_accept4): Remove libc_hidden_def.
* nss/getXXbyYY_r.c (INTERNAL (REENTRANT_NAME)): Conditionalize
use of PTR_MANGLE.
* inet/getnetgrent_r.c (setup): Likewise.
* sysdeps/generic/siglist.h: Put SIGWINCH under #ifdef.
diff --git a/include/sys/socket.h b/include/sys/socket.h
index e356b75..50e6bb3 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -132,11 +132,11 @@ extern int __listen (int __fd, int __n) attribute_hidden;
new socket's descriptor, or -1 for errors. */
extern int __libc_accept (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len)
- __THROW;
+ __THROW attribute_hidden;
libc_hidden_proto (accept)
extern int __libc_accept4 (int __fd, __SOCKADDR_ARG __addr,
socklen_t *__restrict __addr_len, int __flags)
- __THROW;
+ __THROW attribute_hidden;
/* Return the length of a `sockaddr' structure. */
#ifdef _HAVE_SA_LEN
diff --git a/inet/getnetgrent_r.c b/inet/getnetgrent_r.c
index 2e280e7..70cc14c 100644
--- a/inet/getnetgrent_r.c
+++ b/inet/getnetgrent_r.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1996,1997,1998,1999,2002,2004,2005,2007,2011
- Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -57,14 +56,18 @@ setup (void **fctp, service_user **nipp)
same result every time. So we need no locking. */
no_more = __nss_netgroup_lookup (nipp, "setnetgrent", fctp);
startp = no_more ? (service_user *) -1 : *nipp;
+#ifdef PTR_MANGLE
PTR_MANGLE (startp);
+#endif
atomic_write_barrier ();
startp_initialized = true;
}
else
{
service_user *nip = startp;
+#ifdef PTR_DEMANGLE
PTR_DEMANGLE (nip);
+#endif
if (nip == (service_user *) -1)
/* No services at all. */
return 1;
diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
index d197c9b..8ba1e99 100644
--- a/nss/getXXbyYY_r.c
+++ b/nss/getXXbyYY_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996-2004,2006,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -204,7 +204,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
if (no_more)
{
void *tmp_ptr = (service_user *) -1l;
+#ifdef PTR_MANGLE
PTR_MANGLE (tmp_ptr);
+#endif
startp = tmp_ptr;
}
else
@@ -225,10 +227,14 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
#endif /* need _res_hconf */
void *tmp_ptr = fct.l;
+#ifdef PTR_MANGLE
PTR_MANGLE (tmp_ptr);
+#endif
start_fct = tmp_ptr;
tmp_ptr = nip;
+#ifdef PTR_MANGLE
PTR_MANGLE (tmp_ptr);
+#endif
startp = tmp_ptr;
}
@@ -240,9 +246,11 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
else
{
fct.l = start_fct;
- PTR_DEMANGLE (fct.l);
nip = startp;
+#ifdef PTR_DEMANGLE
+ PTR_DEMANGLE (fct.l);
PTR_DEMANGLE (nip);
+#endif
no_more = nip == (service_user *) -1l;
}
diff --git a/socket/accept4.c b/socket/accept4.c
index 7ad1259..fad2cc6 100644
--- a/socket/accept4.c
+++ b/socket/accept4.c
@@ -34,7 +34,6 @@ __libc_accept4 (fd, addr, addr_len, flags)
__set_errno (ENOSYS);
return -1;
}
-libc_hidden_def (__libc_accept4)
weak_alias (__libc_accept4, accept4)
diff --git a/sysdeps/generic/siglist.h b/sysdeps/generic/siglist.h
index d2ad1db..7ecb8ab 100644
--- a/sysdeps/generic/siglist.h
+++ b/sysdeps/generic/siglist.h
@@ -1,5 +1,5 @@
/* Canonical list of all signal names.
- Copyright (C) 1996,97,98,99 Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -50,7 +50,6 @@
init_sig (SIGXFSZ, "XFSZ", N_("File size limit exceeded"))
init_sig (SIGVTALRM, "VTALRM", N_("Virtual timer expired"))
init_sig (SIGPROF, "PROF", N_("Profiling timer expired"))
- init_sig (SIGWINCH, "WINCH", N_("Window changed"))
init_sig (SIGUSR1, "USR1", N_("User defined signal 1"))
init_sig (SIGUSR2, "USR2", N_("User defined signal 2"))
@@ -72,3 +71,6 @@
#ifdef SIGLOST
init_sig (SIGLOST, "LOST", N_("Resource lost"))
#endif
+#ifdef SIGWINCH
+ init_sig (SIGWINCH, "WINCH", N_("Window changed"))
+#endif