This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.16-ports-merge-217-ga084405


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  a0844057776f565316fa56d865266b4995434774 (commit)
      from  750c1f2a9aefc7b3329283c1b0c95e1a0bb88f14 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a0844057776f565316fa56d865266b4995434774

commit a0844057776f565316fa56d865266b4995434774
Author: Roland McGrath <roland@hack.frob.com>
Date:   Fri Aug 17 11:47:06 2012 -0700

    Fix getaddrinfo for [!_STATBUF_ST_NSEC] case.

diff --git a/ChangeLog b/ChangeLog
index 62a6916..357287f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2012-08-17  Roland McGrath  <roland@hack.frob.com>
 
+	* sysdeps/posix/getaddrinfo.c
+	(save_gaiconf_mtime, check_gaiconf_mtime): New functions.
+	(gaiconf_init, gaiconf_reload): Use them.
+	[!_STATBUF_ST_NSEC]
+	(gaiconf_mtime, save_gaiconf_mtime, check_gaiconf_mtime):
+	Define using time_t rather than struct timespec.
+
 	* sysdeps/generic/malloc-machine.h (MUTEX_INITIALIZER): New macro.
 	(atomic_full_barrier, atomic_read_barrier, atomic_write_barrier):
 	Macros removed.
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 78a2474..2638736 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -1855,8 +1855,41 @@ static int gaiconf_reload_flag;
 static int gaiconf_reload_flag_ever_set;
 
 /* Last modification time.  */
+#ifdef _STATBUF_ST_NSEC
+
 static struct timespec gaiconf_mtime;
 
+static inline void
+save_gaiconf_mtime (const struct stat64 *st)
+{
+  gaiconf_mtime = st->st_mtim;
+}
+
+static inline bool
+check_gaiconf_mtime (const struct stat64 *st)
+{
+  return (st->st_mtim.tv_sec == gaiconf_mtime.tv_sec
+          && st->st_mtim.tv_nsec == gaiconf_mtime.tv_nsec);
+}
+
+#else
+
+static time_t gaiconf_mtime;
+
+static inline void
+save_gaiconf_mtime (const struct stat64 *st)
+{
+  gaiconf_mtime = st->st_mtime;
+}
+
+static inline bool
+check_gaiconf_mtime (const struct stat64 *st)
+{
+  return st->mtime == gaiconf_mtime;
+}
+
+#endif
+
 
 libc_freeres_fn(fini)
 {
@@ -2298,7 +2331,7 @@ gaiconf_init (void)
       if (oldscope != default_scopes)
 	free ((void *) oldscope);
 
-      gaiconf_mtime = st.st_mtim;
+      save_gaiconf_mtime (&st);
     }
   else
     {
@@ -2320,7 +2353,7 @@ gaiconf_reload (void)
 {
   struct stat64 st;
   if (__xstat64 (_STAT_VER, GAICONF_FNAME, &st) != 0
-      || memcmp (&st.st_mtim, &gaiconf_mtime, sizeof (gaiconf_mtime)) != 0)
+      || !check_gaiconf_mtime (&st))
     gaiconf_init ();
 }
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |    7 +++++++
 sysdeps/posix/getaddrinfo.c |   37 +++++++++++++++++++++++++++++++++++--
 2 files changed, 42 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]