[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r6350 - in /fsf/trunk/libc: ./ nptl/ nptl/sysdeps/pthread/ nscd/ resolv/nss_dns/ sysdeps/powerpc/powerpc32/fpu/ sysdeps/powe...



Author: eglibc
Date: Fri Jun 13 00:04:46 2008
New Revision: 6350

Log:
Import glibc-mainline for 2008-06-13

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h
    fsf/trunk/libc/nscd/cache.c
    fsf/trunk/libc/nscd/connections.c
    fsf/trunk/libc/nscd/grpcache.c
    fsf/trunk/libc/nscd/initgrcache.c
    fsf/trunk/libc/nscd/nscd.h
    fsf/trunk/libc/nscd/pwdcache.c
    fsf/trunk/libc/nscd/servicescache.c
    fsf/trunk/libc/resolv/nss_dns/dns-host.c
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S
    fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
    fsf/trunk/libc/time/strftime_l.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Jun 13 00:04:46 2008
@@ -1,3 +1,53 @@
+2008-06-12  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* time/strftime.c: Pass reference to tzset_called around to handle
+	recursive calls.
+
+	[BZ #6612]
+	* time/strftime.c (__strftime_internal): Call tzset() only
+	when printing timezone-dependent values.
+	Based on a patch by Petr Baudis <pasky@xxxxxxx>.
+
+	* resolv/nss_dns/dns-host.c (gaih_getanswer): Don't
+	unconditionally use second gaih_getanswer_slice result.
+
+	* sysdeps/posix/getaddrinfo.c (gai_inet): Remove unnecessary test.
+	(getaddrinfo): RES must always be non-NULL.
+
+2008-06-12  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* sysdeps/powerpc/powerpc64/fpu/s_llround.S (__llround): Avoid using
+	cr[34] registers.
+	* sysdeps/powerpc/powerpc64/fpu/s_llroundf.S (__llroundf): Likewise.
+	* sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (__llround):
+	Likewise.
+	* sysdeps/powerpc/powerpc32/fpu/s_lround.S (__lround): Avoid using cr3
+	register.
+
+2008-06-12  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* nscd/nscd.h (struct database_dyn): Add inotify_descr and clear_cache
+	fields.
+	* nscd/connections.c (inotify_fd): New variable.
+	(nscd_init): Try to open an inotify descriptor.
+	If successful, watch files for databases using inotify instead of
+	having prune threads stat the files.
+	(nscd_run_prune): Recognize clear_cache flag being set and call
+	prune_cache appropriately.
+	(main_loop_poll): Add inotify descriptor to wait set and handle the
+	reported changes.
+	(main_loop_epoll): Likewise.
+	* nscd/cache.c (prune_cache): Don't stat files for databases if
+	inotify is used.
+	* sysdeps/unix/sysv/linux/Makefile [subdir=nscd]
+	(CFLAGS-connections.c): Add -DHAVE_INOTIFY.
+
+	* nscd/grpcache.c (cache_addgr): Correctly compute size of
+	fixed-size portion of the record.
+	* nscd/servicescache.c (cache_addserv): Likewise.
+	* nscd/pwdcache.c (cache_addpw): Likewise.
+	* nscd/initgrcache.c (addinitgroupsX): Likewise.
+
 2008-06-11  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* nscd/mem.c (gc): Initialize obstack earlier so that if we jump

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Fri Jun 13 00:04:46 2008
@@ -1,3 +1,7 @@
+2008-06-12  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* sysdeps/pthread/pthread.h: Remove inadvertant checkin.
+
 2008-05-17  Samuel Thibault  <samuel.thibault@xxxxxxxxxxxx>
 
 	* sysdeps/pthread/pthread.h: Fix typo in comment.

Modified: fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h (original)
+++ fsf/trunk/libc/nptl/sysdeps/pthread/pthread.h Fri Jun 13 00:04:46 2008
@@ -122,12 +122,12 @@
 
 /* Read-write lock initializers.  */
 # define PTHREAD_RWLOCK_INITIALIZER \
-  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
+  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
 # ifdef __USE_GNU
 #  if __WORDSIZE == 64
 #   define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
   { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,					      \
-	PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } }
+	PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
 #  else
 #   if __BYTE_ORDER == __LITTLE_ENDIAN
 #    define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \

Modified: fsf/trunk/libc/nscd/cache.c
==============================================================================
--- fsf/trunk/libc/nscd/cache.c (original)
+++ fsf/trunk/libc/nscd/cache.c Fri Jun 13 00:04:46 2008
@@ -274,7 +274,7 @@
 
   /* If we check for the modification of the underlying file we invalidate
      the entries also in this case.  */
-  if (table->check_file && now != LONG_MAX)
+  if (table->inotify_descr < 0 && table->check_file && now != LONG_MAX)
     {
       struct stat64 st;
 

Modified: fsf/trunk/libc/nscd/connections.c
==============================================================================
--- fsf/trunk/libc/nscd/connections.c (original)
+++ fsf/trunk/libc/nscd/connections.c Fri Jun 13 00:04:46 2008
@@ -34,6 +34,9 @@
 #include <arpa/inet.h>
 #ifdef HAVE_EPOLL
 # include <sys/epoll.h>
+#endif
+#ifdef HAVE_INOTIFY
+# include <sys/inotify.h>
 #endif
 #include <sys/mman.h>
 #include <sys/param.h>
@@ -222,6 +225,11 @@
 /* Socket for incoming connections.  */
 static int sock;
 
+#ifdef HAVE_INOTIFY
+/* Inotify descriptor.  */
+static int inotify_fd = -1;
+#endif
+
 /* Number of times clients had to wait.  */
 unsigned long int client_queued;
 
@@ -502,6 +510,13 @@
   if (nthreads == -1)
     /* No configuration for this value, assume a default.  */
     nthreads = 4;
+
+#ifdef HAVE_INOTIFY
+  /* Use inotify to recognize changed files.  */
+  inotify_fd = inotify_init ();
+  if (inotify_fd != -1)
+    fcntl (inotify_fd, F_SETFL, O_NONBLOCK);
+#endif
 
   for (size_t cnt = 0; cnt < lastdb; ++cnt)
     if (dbs[cnt].enabled)
@@ -805,20 +820,30 @@
 	    assert (dbs[cnt].ro_fd == -1);
 	  }
 
+	dbs[cnt].inotify_descr = -1;
 	if (dbs[cnt].check_file)
 	  {
-	    /* We need the modification date of the file.  */
-	    struct stat64 st;
-
-	    if (stat64 (dbs[cnt].filename, &st) < 0)
+#ifdef HAVE_INOTIFY
+	    if (inotify_fd == -1
+		|| (dbs[cnt].inotify_descr
+		    = inotify_add_watch (inotify_fd, dbs[cnt].filename,
+					 IN_DELETE_SELF | IN_MODIFY)) < 0)
+	      /* We cannot notice changes in the main thread.  */
+#endif
 	      {
-		/* We cannot stat() the file, disable file checking.  */
-		dbg_log (_("cannot stat() file `%s': %s"),
-			 dbs[cnt].filename, strerror (errno));
-		dbs[cnt].check_file = 0;
+		/* We need the modification date of the file.  */
+		struct stat64 st;
+
+		if (stat64 (dbs[cnt].filename, &st) < 0)
+		  {
+		    /* We cannot stat() the file, disable file checking.  */
+		    dbg_log (_("cannot stat() file `%s': %s"),
+			     dbs[cnt].filename, strerror (errno));
+		    dbs[cnt].check_file = 0;
+		  }
+		else
+		  dbs[cnt].file_mtime = st.st_mtime;
 	      }
-	    else
-	      dbs[cnt].file_mtime = st.st_mtime;
 	  }
       }
 
@@ -1428,12 +1453,15 @@
   while (1)
     {
       /* Wait, but not forever.  */
-      int e = pthread_cond_timedwait (prune_cond, prune_lock, &prune_ts);
+      int e = 0;
+      if (! dbs[my_number].clear_cache)
+	e = pthread_cond_timedwait (prune_cond, prune_lock, &prune_ts);
       assert (__builtin_expect (e == 0 || e == ETIMEDOUT, 1));
 
       time_t next_wait;
       now = time (NULL);
-      if (e == ETIMEDOUT || now >= dbs[my_number].wakeup_time)
+      if (e == ETIMEDOUT || now >= dbs[my_number].wakeup_time
+	  || dbs[my_number].clear_cache)
 	{
 	  /* We will determine the new timout values based on the
 	     cache content.  Should there be concurrent additions to
@@ -1446,9 +1474,13 @@
 	  else
 	    dbs[my_number].wakeup_time = INT_MAX;
 
+	  /* Unconditionally reset the flag.  */
+	  time_t prune_now = dbs[my_number].clear_cache ? LONG_MAX : now;
+	  dbs[my_number].clear_cache = 0;
+
 	  pthread_mutex_unlock (prune_lock);
 
-	  next_wait = prune_cache (&dbs[my_number], now, -1);
+	  next_wait = prune_cache (&dbs[my_number], prune_now, -1);
 
 	  next_wait = MAX (next_wait, CACHE_PRUNE_INTERVAL);
 	  /* If clients cannot determine for sure whether nscd is running
@@ -1703,6 +1735,16 @@
   size_t nused = 1;
   size_t firstfree = 1;
 
+#ifdef HAVE_INOTIFY
+  if (inotify_fd != -1)
+    {
+      conns[1].fd = inotify_fd;
+      conns[1].events = POLLRDNORM;
+      nused = 2;
+      firstfree = 2;
+    }
+#endif
+
   while (1)
     {
       /* Wait for any event.  We wait at most a couple of seconds so
@@ -1750,7 +1792,42 @@
 	      --n;
 	    }
 
-	  for (size_t cnt = 1; cnt < nused && n > 0; ++cnt)
+	  size_t first = 1;
+#ifdef HAVE_INOTIFY
+	  if (conns[1].fd == inotify_fd)
+	    {
+	      if (conns[1].revents != 0)
+		{
+		  union
+		  {
+		    struct inotify_event i;
+		    char buf[100];
+		  } inev;
+
+		  while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
+						   sizeof (inev)))
+			 >= sizeof (struct inotify_event))
+		    {
+		      /* Check which of the files changed.  */
+		      for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
+			if (inev.i.wd == dbs[dbcnt].inotify_descr)
+			  {
+			    pthread_mutex_trylock (&dbs[dbcnt].prune_lock);
+			    dbs[dbcnt].clear_cache = 1;
+			    pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
+			    pthread_cond_signal (&dbs[dbcnt].prune_cond);
+			    break;
+			  }
+		    }
+
+		  --n;
+		}
+
+	      first = 2;
+	    }
+#endif
+
+	  for (size_t cnt = first; cnt < nused && n > 0; ++cnt)
 	    if (conns[cnt].revents != 0)
 	      {
 		fd_ready (conns[cnt].fd);
@@ -1815,6 +1892,18 @@
   if (epoll_ctl (efd, EPOLL_CTL_ADD, sock, &ev) == -1)
     /* We cannot use epoll.  */
     return;
+
+#ifdef HAVE_INOTIFY
+  if (inotify_fd != -1)
+    {
+      ev.events = EPOLLRDNORM;
+      ev.data.fd = inotify_fd;
+      if (epoll_ctl (efd, EPOLL_CTL_ADD, inotify_fd, &ev) == -1)
+	/* We cannot use epoll.  */
+	return;
+      nused = 2;
+    }
+#endif
 
   while (1)
     {
@@ -1852,6 +1941,32 @@
 		  }
 	      }
 	  }
+#ifdef HAVE_INOTIFY
+	else if (revs[cnt].data.fd == inotify_fd)
+	  {
+	    union
+	    {
+	      struct inotify_event i;
+	      char buf[100];
+	    } inev;
+
+	    while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev,
+					     sizeof (inev)))
+		   >= sizeof (struct inotify_event))
+	      {
+		/* Check which of the files changed.  */
+		for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt)
+		  if (inev.i.wd == dbs[dbcnt].inotify_descr)
+		    {
+		      pthread_mutex_trylock (&dbs[dbcnt].prune_lock);
+		      dbs[dbcnt].clear_cache = 1;
+		      pthread_mutex_unlock (&dbs[dbcnt].prune_lock);
+		      pthread_cond_signal (&dbs[dbcnt].prune_cond);
+		      break;
+		    }
+	      }
+	  }
+#endif
 	else
 	  {
 	    /* Remove the descriptor from the epoll descriptor.  */

Modified: fsf/trunk/libc/nscd/grpcache.c
==============================================================================
--- fsf/trunk/libc/nscd/grpcache.c (original)
+++ fsf/trunk/libc/nscd/grpcache.c Fri Jun 13 00:04:46 2008
@@ -190,7 +190,7 @@
 	  gr_mem_len_total += gr_mem_len[gr_mem_cnt];
 	}
 
-      written = total = (sizeof (struct dataset)
+      written = total = (offsetof (struct dataset, strdata)
 			 + gr_mem_cnt * sizeof (uint32_t)
 			 + gr_name_len + gr_passwd_len + gr_mem_len_total);
 
@@ -251,6 +251,9 @@
       memcpy (cp, buf, n);
       char *key_copy = cp + key_offset;
       assert (key_copy == (char *) rawmemchr (cp, '\0') + 1);
+
+      assert (cp == dataset->strdata + total - offsetof (struct dataset,
+							 strdata));
 
       /* Now we can determine whether on refill we have to create a new
 	 record or not.  */

Modified: fsf/trunk/libc/nscd/initgrcache.c
==============================================================================
--- fsf/trunk/libc/nscd/initgrcache.c (original)
+++ fsf/trunk/libc/nscd/initgrcache.c Fri Jun 13 00:04:46 2008
@@ -246,7 +246,8 @@
   else
     {
 
-      written = total = sizeof (struct dataset) + start * sizeof (int32_t);
+      written = total = (offsetof (struct dataset, strdata)
+			 + start * sizeof (int32_t));
 
       /* If we refill the cache, first assume the reconrd did not
 	 change.  Allocate memory on the cache since it is likely
@@ -306,6 +307,9 @@
 
       /* Finally the user name.  */
       memcpy (cp, key, req->key_len);
+
+      assert (cp == dataset->strdata + total - offsetof (struct dataset,
+							 strdata));
 
       /* Now we can determine whether on refill we have to create a new
 	 record or not.  */

Modified: fsf/trunk/libc/nscd/nscd.h
==============================================================================
--- fsf/trunk/libc/nscd/nscd.h (original)
+++ fsf/trunk/libc/nscd/nscd.h Fri Jun 13 00:04:46 2008
@@ -73,6 +73,8 @@
 
   int enabled;
   int check_file;
+  int inotify_descr;
+  int clear_cache;
   int persistent;
   int shared;
   int propagate;

Modified: fsf/trunk/libc/nscd/pwdcache.c
==============================================================================
--- fsf/trunk/libc/nscd/pwdcache.c (original)
+++ fsf/trunk/libc/nscd/pwdcache.c Fri Jun 13 00:04:46 2008
@@ -185,7 +185,8 @@
       n = snprintf (buf, buf_len, "%d%c%n%s", pwd->pw_uid, '\0',
 		    &key_offset, (char *) key) + 1;
 
-      written = total = (sizeof (struct dataset) + pw_name_len + pw_passwd_len
+      written = total = (offsetof (struct dataset, strdata)
+			 + pw_name_len + pw_passwd_len
 			 + pw_gecos_len + pw_dir_len + pw_shell_len);
 
       /* If we refill the cache, first assume the reconrd did not
@@ -247,16 +248,28 @@
       char *key_copy = cp + key_offset;
       assert (key_copy == (char *) rawmemchr (cp, '\0') + 1);
 
+      assert (cp == dataset->strdata + total - offsetof (struct dataset,
+							 strdata));
+
       /* Now we can determine whether on refill we have to create a new
 	 record or not.  */
       if (he != NULL)
 	{
 	  assert (fd == -1);
 
-	  if (total + n == dh->allocsize
-	      && total - offsetof (struct dataset, resp) == dh->recsize
+#if 0
+	  if (dataset->head.datasize == dh->allocsize
+	      && dataset->head.recsize == dh->recsize
 	      && memcmp (&dataset->resp, dh->data,
 			 dh->allocsize - offsetof (struct dataset, resp)) == 0)
+#else
+	  if (dataset->head.allocsize != dh->allocsize)
+	    goto nnn;
+	  if (dataset->head.recsize != dh->recsize)
+	    goto nnn;
+	  if(memcmp (&dataset->resp, dh->data,
+			 dh->allocsize - offsetof (struct dataset, resp)) == 0)
+#endif
 	    {
 	      /* The data has not changed.  We will just bump the
 		 timeout value.  Note that the new record has been
@@ -266,6 +279,7 @@
 	    }
 	  else
 	    {
+ nnn:;
 	      /* We have to create a new record.  Just allocate
 		 appropriate memory and copy it.  */
 	      struct dataset *newp

Modified: fsf/trunk/libc/nscd/servicescache.c
==============================================================================
--- fsf/trunk/libc/nscd/servicescache.c (original)
+++ fsf/trunk/libc/nscd/servicescache.c Fri Jun 13 00:04:46 2008
@@ -173,7 +173,7 @@
 	  total += s_aliases_len[cnt];
 	}
 
-      total += (sizeof (struct dataset)
+      total += (offsetof (struct dataset, strdata)
 		+ s_name_len
 		+ s_proto_len
 		+ s_aliases_cnt * sizeof (uint32_t));

Modified: fsf/trunk/libc/resolv/nss_dns/dns-host.c
==============================================================================
--- fsf/trunk/libc/resolv/nss_dns/dns-host.c (original)
+++ fsf/trunk/libc/resolv/nss_dns/dns-host.c Fri Jun 13 00:04:46 2008
@@ -1097,11 +1097,7 @@
 
 	  if (__builtin_expect (buflen < sizeof (struct gaih_addrtuple),
 				0))
-	    {
-	      *errnop = ERANGE;
-	      *h_errnop = NETDB_INTERNAL;
-	      return NSS_STATUS_TRYAGAIN;
-	    }
+	    goto too_small;
 
 	  *pat = (struct gaih_addrtuple *) buffer;
 	  buffer += sizeof (struct gaih_addrtuple);
@@ -1175,11 +1171,17 @@
 				  &pat, &buffer, &buflen,
 				  errnop, h_errnop, ttlp,
 				  &first);
-  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND)
+  if ((status == NSS_STATUS_SUCCESS || status == NSS_STATUS_NOTFOUND
+       || status == NSS_STATUS_TRYAGAIN)
       && answer2 != NULL && anslen2 > 0)
-    status = gaih_getanswer_slice(answer2, anslen2, qname,
-				  &pat, &buffer, &buflen,
-				  errnop, h_errnop, ttlp, &first);
+    {
+      enum nss_status status2 = gaih_getanswer_slice(answer2, anslen2, qname,
+						     &pat, &buffer, &buflen,
+						     errnop, h_errnop, ttlp,
+						     &first);
+      if (status != NSS_STATUS_SUCCESS)
+	status = status2;
+    }
 
   return status;
 }

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/fpu/s_lround.S Fri Jun 13 00:04:46 2008
@@ -1,5 +1,5 @@
 /* lround function.  PowerPC32 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -65,10 +65,10 @@
 	fabs	fp2, fp1	/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0.  */
 	fcmpu	cr6, fp2, fp10	/* if |x| < 0.5  */
-	fcmpu	cr3, fp1, fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7, fp1, fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr7,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */ 
 .Lconvert:
 	fctiwz	fp4,fp3		/* Convert to Integer word lround toward 0.  */

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc32/power4/fpu/s_llround.S Fri Jun 13 00:04:46 2008
@@ -1,5 +1,5 @@
 /* llround function.  PowerPC32 on PowerPC64 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -75,12 +75,12 @@
 	fabs	fp2,fp1		/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0 into fpr12.  */
 	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
-	fcmpu	cr4,fp2,fp9	/* if |x| >= 2^52  */
-	fcmpu	cr3,fp1,fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^52  */
+	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
-	bge-	cr4,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
+	bge-	cr7,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
 .Lconvert:
 	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llround.S Fri Jun 13 00:04:46 2008
@@ -1,5 +1,5 @@
 /* llround function.  PowerPC64 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -52,12 +52,12 @@
 	fabs	fp2,fp1		/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0 into fp12.  */
 	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
-	fcmpu	cr4,fp2,fp9	/* if |x| >= 2^52  */
-	fcmpu	cr3,fp1,fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^52  */
+	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
-	bge-	cr4,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
+	bge-	cr7,.Lnobias	/* 2^52 > x < -2^52 just convert with no bias.  */
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
 .Lconvert:
 	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */

Modified: fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S
==============================================================================
--- fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S (original)
+++ fsf/trunk/libc/sysdeps/powerpc/powerpc64/fpu/s_llroundf.S Fri Jun 13 00:04:46 2008
@@ -1,5 +1,5 @@
 /* llroundf function.  PowerPC64 version.
-   Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006, 2007, 2008 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
@@ -51,12 +51,12 @@
 	fabs	fp2,fp1		/* Get the absolute value of x.  */
 	fsub	fp12,fp10,fp10	/* Compute 0.0 into fp12.  */
 	fcmpu	cr6,fp2,fp10	/* if |x| < 0.5  */
-	fcmpu	cr4,fp2,fp9	/* if |x| >= 2^23  */
-	fcmpu	cr3,fp1,fp12	/* x is negative? x < 0.0  */
+	fcmpu	cr7,fp2,fp9	/* if |x| >= 2^23  */
+	fcmpu	cr1,fp1,fp12	/* x is negative? x < 0.0  */
 	blt-	cr6,.Lretzero	/* 0.5 > x < -0.5 so just return 0.  */
-	bge-	cr4,.Lnobias	/* 2^23 > x < -2^23 just convert with no bias.  */
+	bge-	cr7,.Lnobias	/* 2^23 > x < -2^23 just convert with no bias.  */
 	fadd	fp3,fp2,fp10	/* |x|+=0.5 bias to prepare to round.  */
-	bge	cr3,.Lconvert	/* x is positive so don't negate x.  */
+	bge	cr1,.Lconvert	/* x is positive so don't negate x.  */
 	fnabs	fp3,fp3		/* -(|x|+=0.5)  */
 .Lconvert:
 	fctidz	fp4,fp3		/* Convert to Integer double word round toward 0.  */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/Makefile
==============================================================================
Binary files - no diff available.

Modified: fsf/trunk/libc/time/strftime_l.c
==============================================================================
--- fsf/trunk/libc/time/strftime_l.c (original)
+++ fsf/trunk/libc/time/strftime_l.c Fri Jun 13 00:04:46 2008
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2004, 2007, 2008 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
@@ -455,7 +455,8 @@
 #endif
 
 static size_t __strftime_internal (CHAR_T *, size_t, const CHAR_T *,
-				   const struct tm *, bool ut_argument_spec_iso
+				   const struct tm *, bool *
+				   ut_argument_spec_iso
 				   LOCALE_PARAM_PROTO) __THROW;
 
 /* Write information from TP into S according to the format
@@ -481,7 +482,8 @@
   tmcopy = *tp;
   tp = &tmcopy;
 #endif
-  return __strftime_internal (s, maxsize, format, tp, false
+  bool tzset_called = false;
+  return __strftime_internal (s, maxsize, format, tp, &tzset_called
 			      ut_argument LOCALE_ARG);
 }
 #ifdef _LIBC
@@ -495,7 +497,7 @@
       size_t maxsize;
       const CHAR_T *format;
       const struct tm *tp;
-      bool tzset_called;
+      bool *tzset_called;
       ut_argument_spec
       LOCALE_PARAM_DECL
 {
@@ -562,16 +564,6 @@
     {
       if (! (zone && *zone))
 	zone = "GMT";
-    }
-  else
-    {
-      /* POSIX.1 requires that local time zone information is used as
-	 though strftime called tzset.  */
-# if HAVE_TZSET
-      if (!tzset_called)
-	tzset ();
-      tzset_called = true;
-# endif
     }
 #endif
 
@@ -1325,7 +1317,18 @@
 #if HAVE_TZNAME
 	  /* The tzset() call might have changed the value.  */
 	  if (!(zone && *zone) && tp->tm_isdst >= 0)
-	    zone = tzname[tp->tm_isdst];
+	    {
+	      /* POSIX.1 requires that local time zone information is used as
+		 though strftime called tzset.  */
+# if HAVE_TZSET
+	      if (!*tzset_called)
+		{
+		  tzset ();
+		  *tzset_called = true;
+		}
+# endif
+	      zone = tzname[tp->tm_isdst];
+	    }
 #endif
 	  if (! zone)
 	    zone = "";
@@ -1360,6 +1363,16 @@
 		struct tm gtm;
 		struct tm ltm;
 		time_t lt;
+
+		/* POSIX.1 requires that local time zone information is used as
+		   though strftime called tzset.  */
+# if HAVE_TZSET
+		if (!*tzset_called)
+		  {
+		    tzset ();
+		    *tzset_called = true;
+		  }
+# endif
 
 		ltm = *tp;
 		lt = mktime (&ltm);