This is the mail archive of the libc-alpha@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]

[patch] fix build error in getaddrinfo.c introduced by configuration file patch (gai.conf)


the last change to getaddrinfo.c broke compiling as the member in the st 
structure contains some typos ... 'st.st_mtim' was used instead 
of 'st.st_mtime' ...

fixing this leads to a build error where the gaiconf_mtime variable cannot be 
assigned the value of st.st_mtime ... this is because gaiconf_mtime is 
declared as a 'struct timestruct' while the st_mtime is a 'time_t' ...

ive made the assumption that gaiconf_mtime should actually be 'time_t' and as 
such, ive also changed the gaiconf_reload() to simply compare the values with 
the != operator instead of memcmp()
-mike
2006-05-06  Mike Frysinger  <vapier@gentoo.org>

	* sysdeps/posix/getaddrinfo.c (gaiconf_mtime): Declare as time_t.
	(gaiconf_init): Fix typo st.st_mtime.
	(gaiconf_reload): Likewise.  Use != instead of memcmp() to compare times.

--- sysdeps/posix/getaddrinfo.c
+++ sysdeps/posix/getaddrinfo.c
@@ -1513,7 +1513,7 @@ in6aicmp (const void *p1, const void *p2
 static int gaiconf_reload_flag;
 
 /* Last modification time.  */
-static struct timespec gaiconf_mtime;
+static time_t gaiconf_mtime;
 
 
 libc_freeres_fn(fini)
@@ -1795,7 +1795,7 @@ gaiconf_init (void)
       if (old != default_precedence)
 	free ((void *) old);
 
-      gaiconf_mtime = st.st_mtim;
+      gaiconf_mtime = st.st_mtime;
     }
   else
     {
@@ -1816,7 +1816,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)
+      || st.st_mtime != gaiconf_mtime)
     gaiconf_init ();
 }
 

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