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

[commits] r8356 - in /fsf/trunk/libc: ./ iconv/ iconvdata/ locale/ locale/programs/ localedata/ localedata/locales/ misc/ stdio-common/



Author: eglibc
Date: Sat Apr 25 00:05:10 2009
New Revision: 8356

Log:
Import glibc-mainline for 2009-04-25

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/iconv/gconv_simple.c
    fsf/trunk/libc/iconvdata/sjis.c
    fsf/trunk/libc/locale/locarchive.h
    fsf/trunk/libc/locale/programs/locarchive.c
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/locales/cs_CZ
    fsf/trunk/libc/localedata/locales/csb_PL
    fsf/trunk/libc/localedata/locales/da_DK
    fsf/trunk/libc/localedata/locales/de_DE
    fsf/trunk/libc/localedata/locales/en_GB
    fsf/trunk/libc/localedata/locales/et_EE
    fsf/trunk/libc/localedata/locales/fr_FR
    fsf/trunk/libc/localedata/locales/fur_IT
    fsf/trunk/libc/localedata/locales/fy_DE
    fsf/trunk/libc/localedata/locales/ht_HT
    fsf/trunk/libc/localedata/locales/hu_HU
    fsf/trunk/libc/localedata/locales/li_BE
    fsf/trunk/libc/localedata/locales/li_NL
    fsf/trunk/libc/localedata/locales/mk_MK
    fsf/trunk/libc/localedata/locales/nb_NO
    fsf/trunk/libc/localedata/locales/nds_DE
    fsf/trunk/libc/localedata/locales/nds_NL
    fsf/trunk/libc/localedata/locales/nn_NO
    fsf/trunk/libc/localedata/locales/pl_PL
    fsf/trunk/libc/localedata/locales/sc_IT
    fsf/trunk/libc/localedata/locales/sk_SK
    fsf/trunk/libc/localedata/locales/sr_ME
    fsf/trunk/libc/localedata/locales/sr_RS
    fsf/trunk/libc/localedata/locales/sr_RS@latin
    fsf/trunk/libc/localedata/locales/uk_UA
    fsf/trunk/libc/misc/hsearch_r.c
    fsf/trunk/libc/stdio-common/psiginfo.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Apr 25 00:05:10 2009
@@ -1,3 +1,40 @@
+2009-04-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #10093]
+	* iconv/gconv_simple.c (BODY for UTF-8 to INTERNAL): Don't accept
+	UTF-16 surrogates.
+
+	* locale/programs/locarchive.c (enlarge_archive): Conserve address
+	space when temporarily mapping the whole content of the old file.
+
+	[BZ #10100]
+	* misc/hsearch_r.c (hsearch_r): Add back ensurance that hval is
+	not zero.
+
+2009-04-24  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	* iconvdata/sjis.c (BODY): Don't advance inptr before
+	STANDARD_FROM_LOOP_ERR_HANDLER (2) for 2 byte invalid input.
+	Use STANDARD_FROM_LOOP_ERR_HANDLER with 2 instead of 1 for
+	two byte chars.
+
+2009-04-24  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* locale/locarchive.h (struct locarhandle): Rename len field to
+	mmaped and add new reserved field.
+	* locale/programs/locarchive.c (RESERVE_MMAP_SIZE): Define.
+	(create_archive): Reserve address space and then map file into it.
+	(open_archive): Likewise.
+	(file_data_available_p): New function.
+	(compare_from_file): New function.
+	(close_archive): Adjust to member name changes.
+	(add_locale): Before comparing locale data, check it is mapped.
+	Otherwise fall back to reading from the file.
+
+2009-04-23  H.J. Lu  <hongjiu.lu@xxxxxxxxx>
+
+	* stdio-common/psiginfo.c: Include <errno.h>.
+
 2009-04-23  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #9920]

Modified: fsf/trunk/libc/iconv/gconv_simple.c
==============================================================================
--- fsf/trunk/libc/iconv/gconv_simple.c (original)
+++ fsf/trunk/libc/iconv/gconv_simple.c Sat Apr 25 00:05:10 2009
@@ -1,5 +1,5 @@
 /* Simple transformations functions.
-   Copyright (C) 1997-2005, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1997-2005, 2007, 2008, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -1037,7 +1037,9 @@
 	/* If i < cnt, some trail byte was not >= 0x80, < 0xc0.		      \
 	   If cnt > 2 and ch < 2^(5*cnt-4), the wide character ch could	      \
 	   have been represented with fewer than cnt bytes.  */		      \
-	if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0))		      \
+	if (i < cnt || (cnt > 2 && (ch >> (5 * cnt - 4)) == 0)		      \
+	    /* Do not accept UTF-16 surrogates.  */			      \
+	    || (ch >= 0xd800 && ch <= 0xdfff))				      \
 	  {								      \
 	    /* This is an illegal encoding.  */				      \
 	    goto errout;						      \

Modified: fsf/trunk/libc/iconvdata/sjis.c
==============================================================================
--- fsf/trunk/libc/iconvdata/sjis.c (original)
+++ fsf/trunk/libc/iconvdata/sjis.c Sat Apr 25 00:05:10 2009
@@ -1,5 +1,5 @@
 /* Mapping tables for SJIS handling.
-   Copyright (C) 1997-2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997-2001, 2002, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1997.
 
@@ -4372,14 +4372,18 @@
 									      \
 	ch2 = inptr[1];							      \
 	idx = ch * 256 + ch2;						      \
-	if (__builtin_expect (ch2 < 0x40, 0)				      \
-	    || (__builtin_expect (idx > 0x84be, 0) && idx < 0x889f)	      \
-	    || (__builtin_expect (idx > 0x88fc, 0) && idx < 0x8940)	      \
-	    || (__builtin_expect (idx > 0x9ffc, 0) && idx < 0xe040)	      \
-	    || __builtin_expect (idx > 0xeaa4, 0))			      \
+	if (__builtin_expect (ch2 < 0x40, 0))				      \
 	  {								      \
 	    /* This is illegal.  */					      \
 	    STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
+	  }								      \
+	else if ((__builtin_expect (idx > 0x84be && idx < 0x889f, 0))	      \
+		 || (__builtin_expect (idx > 0x88fc && idx < 0x8940, 0))      \
+		 || (__builtin_expect (idx > 0x9ffc && idx < 0xe040, 0))      \
+		 || __builtin_expect (idx > 0xeaa4, 0))			      \
+	  {								      \
+	    /* This is illegal.  */					      \
+	    STANDARD_FROM_LOOP_ERR_HANDLER (2);				      \
 	  }								      \
 	else								      \
 	  {								      \
@@ -4395,13 +4399,13 @@
 	    else							      \
 	      ch = cjk_block4[(ch - 0xe0) * 192 + ch2 - 0x40];		      \
 									      \
+	    if (__builtin_expect (ch == 0, 0))				      \
+	      {								      \
+		/* This is an illegal character.  */			      \
+		STANDARD_FROM_LOOP_ERR_HANDLER (2);			      \
+	      }								      \
+									      \
 	    inptr += 2;							      \
-	  }								      \
-									      \
-	if (__builtin_expect (ch == 0, 0))				      \
-	  {								      \
-	    /* This is an illegal character.  */			      \
-	    STANDARD_FROM_LOOP_ERR_HANDLER (2);				      \
 	  }								      \
       }									      \
 									      \

Modified: fsf/trunk/libc/locale/locarchive.h
==============================================================================
--- fsf/trunk/libc/locale/locarchive.h (original)
+++ fsf/trunk/libc/locale/locarchive.h Sat Apr 25 00:05:10 2009
@@ -1,5 +1,5 @@
 /* Definitions for locale archive handling.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009 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
@@ -83,7 +83,8 @@
 {
   int fd;
   void *addr;
-  size_t len;
+  size_t mmaped;
+  size_t reserved;
 };
 
 

Modified: fsf/trunk/libc/locale/programs/locarchive.c
==============================================================================
--- fsf/trunk/libc/locale/programs/locarchive.c (original)
+++ fsf/trunk/libc/locale/programs/locarchive.c Sat Apr 25 00:05:10 2009
@@ -71,6 +71,10 @@
 #define INITIAL_NUM_SUMS	2000
 
 
+/* Size of the reserved address space area.  */
+#define RESERVE_MMAP_SIZE	512 * 1024 * 1024
+
+
 static void
 create_archive (const char *archivefname, struct locarhandle *ah)
 {
@@ -125,8 +129,22 @@
       error (EXIT_FAILURE, errval, _("cannot resize archive file"));
     }
 
+  /* To prepare for enlargements of the mmaped area reserve some
+     address space.  */
+  size_t reserved = RESERVE_MMAP_SIZE;
+  int xflags = 0;
+  if (total < reserved
+      && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_ANON, -1, 0))
+	  != MAP_FAILED))
+    xflags = MAP_FIXED;
+  else
+    {
+      p = NULL;
+      reserved = total;
+    }
+
   /* Map the header and all the administration data structures.  */
-  p = mmap64 (NULL, total, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+  p = mmap64 (p, total, PROT_READ | PROT_WRITE, MAP_SHARED | xflags, fd, 0);
   if (p == MAP_FAILED)
     {
       int errval = errno;
@@ -170,7 +188,8 @@
 
   ah->fd = fd;
   ah->addr = p;
-  ah->len = total;
+  ah->mmaped = total;
+  ah->reserved = reserved;
 }
 
 
@@ -225,6 +244,45 @@
 static void add_alias (struct locarhandle *ah, const char *alias,
 		       bool replace, const char *oldname,
 		       uint32_t *locrec_offset_p);
+
+
+static bool
+file_data_available_p (struct locarhandle *ah, uint32_t offset, uint32_t size)
+{
+  if (offset < ah->mmaped && offset + size <= ah->mmaped)
+    return true;
+
+  struct stat64 st;
+  if (fstat64 (ah->fd, &st) != 0)
+    return false;
+
+  if (st.st_size > ah->reserved)
+    return false;
+
+  void *p = mremap (ah->addr, ah->mmaped, st.st_size,
+		    MREMAP_FIXED | MREMAP_MAYMOVE, ah->addr);
+  if (p == MAP_FAILED)
+    return false;
+
+  ah->mmaped = st.st_size;
+  return true;
+}
+
+
+static int
+compare_from_file (struct locarhandle *ah, void *p1, uint32_t offset2,
+		   uint32_t size)
+{
+  void *p2 = xmalloc (size);
+  if (pread (ah->fd, p2, size, offset2) != size)
+    WITH_CUR_LOCALE (error (4, errno,
+			    _("cannot read data from locale archive")));
+
+  int res = memcmp (p1, p2, size);
+  free (p2);
+  return res;
+}
+
 
 static void
 enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
@@ -249,11 +307,23 @@
 
   /* Not all of the old file has to be mapped.  Change this now this
      we will have to access the whole content.  */
-  if (fstat64 (ah->fd, &st) != 0
-      || (ah->addr = mmap64 (NULL, st.st_size, PROT_READ | PROT_WRITE,
-			     MAP_SHARED, ah->fd, 0)) == MAP_FAILED)
+  if (fstat64 (ah->fd, &st) != 0)
+  enomap:
     error (EXIT_FAILURE, errno, _("cannot map locale archive file"));
-  ah->len = st.st_size;
+
+  if (st.st_size < ah->reserved)
+    ah->addr = mremap (ah->addr, ah->mmaped, st.st_size,
+		       MREMAP_MAYMOVE | MREMAP_FIXED, ah->addr);
+  else
+    {
+      munmap (ah->addr, ah->reserved);
+      ah->addr = mmap64 (NULL, st.st_size, PROT_READ | PROT_WRITE,
+			 MAP_SHARED, ah->fd, 0);
+      ah->reserved = st.st_size;
+    }
+  if (ah->addr == MAP_FAILED)
+    goto enomap;
+  ah->mmaped = st.st_size;
 
   /* Create a temporary file in the correct directory.  */
   fd = mkstemp (fname);
@@ -331,9 +401,10 @@
       error (EXIT_FAILURE, errval, _("cannot lock new archive"));
     }
 
-  new_ah.len = total;
+  new_ah.mmaped = total;
   new_ah.addr = p;
   new_ah.fd = fd;
+  new_ah.reserved = total;
 
   /* Walk through the hash name hash table to find out what data is
      still referenced and transfer it into the new file.  */
@@ -514,18 +585,33 @@
     }
 
   ah->fd = fd;
-  ah->len = (head.sumhash_offset
-	     + head.sumhash_size * sizeof (struct sumhashent));
+  ah->mmaped = st.st_size;
+
+  /* To prepare for enlargements of the mmaped area reserve some
+     address space.  */
+  size_t reserved = RESERVE_MMAP_SIZE;
+  int xflags = 0;
+  void *p;
+  if (st.st_size < reserved
+      && ((p = mmap64 (NULL, RESERVE_MMAP_SIZE, PROT_NONE, MAP_ANON, -1, 0))
+	  != MAP_FAILED))
+    xflags = MAP_FIXED;
+  else
+    {
+      p = NULL;
+      reserved = st.st_size;
+    }
 
   /* Map the entire file.  We might need to compare the category data
      in the file with the newly added data.  */
-  ah->addr = mmap64 (NULL, st.st_size, PROT_READ | (readonly ? 0 : PROT_WRITE),
-		     MAP_SHARED, fd, 0);
+  ah->addr = mmap64 (p, st.st_size, PROT_READ | (readonly ? 0 : PROT_WRITE),
+		     MAP_SHARED | xflags, fd, 0);
   if (ah->addr == MAP_FAILED)
     {
       (void) lockf64 (fd, F_ULOCK, sizeof (struct locarhead));
       error (EXIT_FAILURE, errno, _("cannot map archive header"));
     }
+  ah->reserved = reserved;
 }
 
 
@@ -534,7 +620,7 @@
 {
   if (ah->fd != -1)
     {
-      munmap (ah->addr, ah->len);
+      munmap (ah->addr, ah->reserved);
       close (ah->fd);
     }
 }
@@ -777,9 +863,18 @@
 
 		if (iloc != head->locrectab_used
 		    && data[cnt].size == locrecent[iloc].record[cnt].len
-		    && memcmp (data[cnt].addr,
-			       (char *) ah->addr + sumhashtab[idx].file_offset,
-			       data[cnt].size) == 0)
+		    /* We have to compare the content.  Either we can
+		       have the data mmaped or we have to read from
+		       the file.  */
+		    && (file_data_available_p (ah, sumhashtab[idx].file_offset,
+					       data[cnt].size)
+			? memcmp (data[cnt].addr,
+				  (char *) ah->addr
+				  + sumhashtab[idx].file_offset,
+				  data[cnt].size) == 0
+			: compare_from_file (ah, data[cnt].addr,
+					     sumhashtab[idx].file_offset,
+					     data[cnt].size) == 0))
 		  {
 		    /* Found it.  */
 		    file_offsets[cnt] = sumhashtab[idx].file_offset;

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Sat Apr 25 00:05:10 2009
@@ -1,3 +1,34 @@
+2009-03-08  Samuel Thibault  <samuel.thibault@xxxxxxxxxxxx>
+
+	* locales/cs.CZ: Change week[2] to 19971130, change first_weekday and
+	first_workday to 2.
+	* locales/da_DK: Likewise.
+	* locales/de_DE: Likewise.
+	* locales/fr_FR: Likewise.
+	* locales/fur_IT: Likewise.
+	* locales/fy_DE: Likewise.
+	* locales/ht_HT: Likewise.
+	* locales/hu_HU: Likewise.
+	* locales/li_BE: Likewise.
+	* locales/li_NL: Likewise.
+	* locales/mk_MK: Likewise.
+	* locales/nb_NO: Likewise.
+	* locales/nds_DE: Likewise.
+	* locales/nds_NL: Likewise.
+	* locales/nn_NO: Likewise.
+	* locales/pl_PL: Likewise.
+	* locales/sc_IT: Likewise.
+	* locales/sk_SK: Likewise.
+	* locales/uk_UA: Likewise.
+
+	* locales/csb_PL: Change week[2] to 19971130.
+	* locales/en_GB: Likewise.
+	* locales/et_EE: Likewise.
+
+	* locales/sr_ME: Set week to 7;19971130;4.
+	* locales/sr_RS: Likewise.
+	* locales/sr_RS@latin: Likewise.
+
 2009-04-22  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	[BZ #9963]

Modified: fsf/trunk/libc/localedata/locales/cs_CZ
==============================================================================
--- fsf/trunk/libc/localedata/locales/cs_CZ (original)
+++ fsf/trunk/libc/localedata/locales/cs_CZ Sat Apr 25 00:05:10 2009
@@ -2438,9 +2438,9 @@
 %		"<U004E><U006F><U0076>";/
 %		"<U0044><U0065><U0063>"
 
-week		7;19971201;4
-first_weekday	1
-first_workday	1
+week		7;19971130;4
+first_weekday	2
+first_workday	2
 
 d_t_fmt		"<U0025><U0061><U00A0><U0025><U002D><U0064><U002E><U00A0><U0025><U0042><U00A0><U0025><U0059><U002C><U00A0><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U00A0><U0025><U005A>"
 

Modified: fsf/trunk/libc/localedata/locales/csb_PL
==============================================================================
--- fsf/trunk/libc/localedata/locales/csb_PL (original)
+++ fsf/trunk/libc/localedata/locales/csb_PL Sat Apr 25 00:05:10 2009
@@ -184,7 +184,7 @@
 date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week    7;19971201;4
+week    7;19971130;4
 first_weekday 2
 first_workday 2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/da_DK
==============================================================================
--- fsf/trunk/libc/localedata/locales/da_DK (original)
+++ fsf/trunk/libc/localedata/locales/da_DK Sat Apr 25 00:05:10 2009
@@ -209,9 +209,9 @@
 date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week    7;19971201;4
-first_weekday 1
-first_workday 1
+week    7;19971130;4
+first_weekday 2
+first_workday 2
 END LC_TIME
 
 LC_MESSAGES

Modified: fsf/trunk/libc/localedata/locales/de_DE
==============================================================================
--- fsf/trunk/libc/localedata/locales/de_DE (original)
+++ fsf/trunk/libc/localedata/locales/de_DE Sat Apr 25 00:05:10 2009
@@ -155,9 +155,9 @@
 <U0025><U0062><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>/
 <U0020><U0025><U005A><U0020><U0025><U0059>"
 
-week    7;19971201;4
-first_weekday 1
-first_workday 1
+week    7;19971130;4
+first_weekday 2
+first_workday 2
 END LC_TIME
 
 LC_MESSAGES

Modified: fsf/trunk/libc/localedata/locales/en_GB
==============================================================================
--- fsf/trunk/libc/localedata/locales/en_GB (original)
+++ fsf/trunk/libc/localedata/locales/en_GB Sat Apr 25 00:05:10 2009
@@ -121,7 +121,7 @@
 date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week    7;19971201;4
+week    7;19971130;4
 first_weekday 2
 first_workday 2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/et_EE
==============================================================================
--- fsf/trunk/libc/localedata/locales/et_EE (original)
+++ fsf/trunk/libc/localedata/locales/et_EE Sat Apr 25 00:05:10 2009
@@ -2196,7 +2196,7 @@
 date_fmt	"<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week    7;19971201;4
+week    7;19971130;4
 first_weekday 1
 first_workday 1
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/fr_FR
==============================================================================
--- fsf/trunk/libc/localedata/locales/fr_FR (original)
+++ fsf/trunk/libc/localedata/locales/fr_FR Sat Apr 25 00:05:10 2009
@@ -141,9 +141,9 @@
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
 
-week    7;19971201;4
-first_weekday 1
-first_workday 1
+week    7;19971130;4
+first_weekday 2
+first_workday 2
 END LC_TIME
 
 LC_PAPER

Modified: fsf/trunk/libc/localedata/locales/fur_IT
==============================================================================
--- fsf/trunk/libc/localedata/locales/fur_IT (original)
+++ fsf/trunk/libc/localedata/locales/fur_IT Sat Apr 25 00:05:10 2009
@@ -110,9 +110,9 @@
 date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week			7;19971201;4
-first_weekday		1
-first_workday		1
+week			7;19971130;4
+first_weekday		2
+first_workday		2
 END LC_TIME
 
 LC_PAPER

Modified: fsf/trunk/libc/localedata/locales/fy_DE
==============================================================================
--- fsf/trunk/libc/localedata/locales/fy_DE (original)
+++ fsf/trunk/libc/localedata/locales/fy_DE Sat Apr 25 00:05:10 2009
@@ -127,7 +127,7 @@
 t_fmt   "<U0025><U0054>"
 am_pm   "";""
 t_fmt_ampm ""
-week	7;19971201;4
-first_weekday	1
-first_workday	1
+week	7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/ht_HT
==============================================================================
--- fsf/trunk/libc/localedata/locales/ht_HT (original)
+++ fsf/trunk/libc/localedata/locales/ht_HT Sat Apr 25 00:05:10 2009
@@ -139,9 +139,9 @@
 <U0020><U0025><U0068><U003A><U0025><U006D><U003A><U0025><U0073><U0020>/
 <U0025><U005A><U0020><U0025><U0079>"
 
-week    7;19971201;4
-first_weekday 1
-first_workday 1
+week    7;19971130;4
+first_weekday 2
+first_workday 2
 END LC_TIME
 
 LC_PAPER

Modified: fsf/trunk/libc/localedata/locales/hu_HU
==============================================================================
--- fsf/trunk/libc/localedata/locales/hu_HU (original)
+++ fsf/trunk/libc/localedata/locales/hu_HU Sat Apr 25 00:05:10 2009
@@ -520,9 +520,9 @@
 t_fmt_ampm "<U0025><U0048><U002E><U0025><U004D><U002E><U0025><U0053>"
 date_fmt "<U0025><U0059><U002E><U0020><U0025><U0062><U002E><U0020><U0025><U0065><U002E><U002C>/
 <U0020><U0025><U0041><U002C><U0020><U0025><U0048><U002E><U0025><U004D><U002E><U0025><U0053><U0020><U0025><U005A>"
-week     7;19971201;4
-first_weekday	1
-first_workday	1
+week     7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME
 
 LC_PAPER

Modified: fsf/trunk/libc/localedata/locales/li_BE
==============================================================================
--- fsf/trunk/libc/localedata/locales/li_BE (original)
+++ fsf/trunk/libc/localedata/locales/li_BE Sat Apr 25 00:05:10 2009
@@ -126,7 +126,7 @@
 t_fmt   "<U0025><U0054>"
 am_pm   "";""
 t_fmt_ampm ""
-week	7;19971201;4
-first_weekday	1
-first_workday	1
+week	7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/li_NL
==============================================================================
--- fsf/trunk/libc/localedata/locales/li_NL (original)
+++ fsf/trunk/libc/localedata/locales/li_NL Sat Apr 25 00:05:10 2009
@@ -127,7 +127,7 @@
 t_fmt   "<U0025><U0054>"
 am_pm   "";""
 t_fmt_ampm ""
-week	7;19971201;4
-first_weekday	1
-first_workday	1
+week	7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/mk_MK
==============================================================================
--- fsf/trunk/libc/localedata/locales/mk_MK (original)
+++ fsf/trunk/libc/localedata/locales/mk_MK Sat Apr 25 00:05:10 2009
@@ -85,9 +85,9 @@
 date_fmt "<U0025><U0061><U002C><U0020><U0025><U0064><U0020><U0025><U0062>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week    7;19971201;4
-first_weekday 1 % Monday
-first_workday 1 % Monday
+week    7;19971130;4
+first_weekday 2 % Monday
+first_workday 2 % Monday
 END LC_TIME
 
 LC_MONETARY

Modified: fsf/trunk/libc/localedata/locales/nb_NO
==============================================================================
--- fsf/trunk/libc/localedata/locales/nb_NO (original)
+++ fsf/trunk/libc/localedata/locales/nb_NO Sat Apr 25 00:05:10 2009
@@ -201,9 +201,9 @@
 <U0062><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>/
 <U0020><U0025><U007A><U0020><U0025><U0059>"
 
-week    7;19971201;4
-first_weekday 1
-first_workday 1
+week    7;19971130;4
+first_weekday 2
+first_workday 2
 END LC_TIME
 
 LC_MESSAGES

Modified: fsf/trunk/libc/localedata/locales/nds_DE
==============================================================================
--- fsf/trunk/libc/localedata/locales/nds_DE (original)
+++ fsf/trunk/libc/localedata/locales/nds_DE Sat Apr 25 00:05:10 2009
@@ -125,7 +125,7 @@
 t_fmt   "<U0025><U0054>"
 am_pm   "";""
 t_fmt_ampm ""
-week	7;19971201;4
-first_weekday	1
-first_workday	1
+week	7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/nds_NL
==============================================================================
--- fsf/trunk/libc/localedata/locales/nds_NL (original)
+++ fsf/trunk/libc/localedata/locales/nds_NL Sat Apr 25 00:05:10 2009
@@ -124,7 +124,7 @@
 t_fmt   "<U0025><U0054>"
 am_pm   "";""
 t_fmt_ampm ""
-week	7;19971201;4
-first_weekday	1
-first_workday	1
+week	7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/nn_NO
==============================================================================
--- fsf/trunk/libc/localedata/locales/nn_NO (original)
+++ fsf/trunk/libc/localedata/locales/nn_NO Sat Apr 25 00:05:10 2009
@@ -128,9 +128,9 @@
 <U0062><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053>/
 <U0020><U0025><U007A><U0020><U0025><U0059>"
 
-week    7;19971201;4
-first_weekday 1
-first_workday 1
+week    7;19971130;4
+first_weekday 2
+first_workday 2
 END LC_TIME
 
 

Modified: fsf/trunk/libc/localedata/locales/pl_PL
==============================================================================
--- fsf/trunk/libc/localedata/locales/pl_PL (original)
+++ fsf/trunk/libc/localedata/locales/pl_PL Sat Apr 25 00:05:10 2009
@@ -2196,9 +2196,9 @@
 date_fmt "<U0025><U0061><U002C><U0020>/
 <U0025><U002D><U0064><U0020><U0025><U0062><U0020><U0025><U0059><U002C><U0020>/
 <U0025><U0054><U0020><U0025><U005A>"
-week	7;19971201;4
-first_weekday	1
-first_workday	1
+week	7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME
 
 LC_PAPER

Modified: fsf/trunk/libc/localedata/locales/sc_IT
==============================================================================
--- fsf/trunk/libc/localedata/locales/sc_IT (original)
+++ fsf/trunk/libc/localedata/locales/sc_IT Sat Apr 25 00:05:10 2009
@@ -110,9 +110,9 @@
 date_fmt       "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
-week	7;19971201;4
-first_weekday	1
-first_workday	1
+week	7;19971130;4
+first_weekday	2
+first_workday	2
 END LC_TIME
 
 LC_PAPER

Modified: fsf/trunk/libc/localedata/locales/sk_SK
==============================================================================
--- fsf/trunk/libc/localedata/locales/sk_SK (original)
+++ fsf/trunk/libc/localedata/locales/sk_SK Sat Apr 25 00:05:10 2009
@@ -183,9 +183,9 @@
 <U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020>/
 <U0025><U005A><U0020><U0025><U0059>"
 
-week		7;19971201;4
-first_weekday	1
-first_workday	1
+week		7;19971130;4
+first_weekday	2
+first_workday	2
 
 END LC_TIME
 

Modified: fsf/trunk/libc/localedata/locales/sr_ME
==============================================================================
--- fsf/trunk/libc/localedata/locales/sr_ME (original)
+++ fsf/trunk/libc/localedata/locales/sr_ME Sat Apr 25 00:05:10 2009
@@ -120,7 +120,7 @@
 date_fmt  "<U0025><U0061><U002c><U0020><U0025><U0065><U002E><U0020>/
 <U0025><U0062><U0020><U0025><U0059><U002E><U0020><U0020><U0025><U0048>/
 <U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U000A>"
-% week    7;19971201;4
+week    7;19971130;4
 first_weekday 2
 first_workday 2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/sr_RS
==============================================================================
--- fsf/trunk/libc/localedata/locales/sr_RS (original)
+++ fsf/trunk/libc/localedata/locales/sr_RS Sat Apr 25 00:05:10 2009
@@ -301,7 +301,7 @@
 date_fmt  "<U0025><U0061><U002C><U0020><U0025><U0065><U002E><U0020>/
 <U0025><U0062><U0020><U0025><U0059><U002E><U0020><U0020><U0025><U0048>/
 <U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U000A>"
-% week    7;19971201;4
+week    7;19971130;4
 first_weekday 2
 first_workday 2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/sr_RS@latin
==============================================================================
--- fsf/trunk/libc/localedata/locales/sr_RS@latin (original)
+++ fsf/trunk/libc/localedata/locales/sr_RS@latin Sat Apr 25 00:05:10 2009
@@ -121,7 +121,7 @@
 date_fmt  "<U0025><U0061><U002c><U0020><U0025><U0065><U002E><U0020>/
 <U0025><U0062><U0020><U0025><U0059><U002E><U0020><U0020><U0025><U0048>/
 <U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A><U000A>"
-% week    7;19971201;4
+week    7;19971130;4
 first_weekday 2
 first_workday 2
 END LC_TIME

Modified: fsf/trunk/libc/localedata/locales/uk_UA
==============================================================================
--- fsf/trunk/libc/localedata/locales/uk_UA (original)
+++ fsf/trunk/libc/localedata/locales/uk_UA Sat Apr 25 00:05:10 2009
@@ -901,7 +901,9 @@
 %
 % ISO 8601 conforming applications should use the values 7, 19971201 (a
 % Monday), and 4 (Thursday), respectively.
-week 7;19971201;4
+% week 7;19971201;4
+% But see BUG below.
+week 7;19971130;4
 
 % A list of abbreviated weekday names. (%a)
 %
@@ -1015,10 +1017,10 @@
 
 % Define the first day of the week to be displayed in a calendar.
 % This weekday is relative to the date defined in the <week> keyword.
-first_weekday 1
+first_weekday 2
 
 % Define the first workday relative to the <week> keyword
-first_workday 1
+first_workday 2
 
 % Zymovyj CHas (winter time) or z.ch. (or nothing)
 % Litnij CHas (summer time) or l.ch.

Modified: fsf/trunk/libc/misc/hsearch_r.c
==============================================================================
--- fsf/trunk/libc/misc/hsearch_r.c (original)
+++ fsf/trunk/libc/misc/hsearch_r.c Sat Apr 25 00:05:10 2009
@@ -157,6 +157,8 @@
       hval <<= 4;
       hval += item.key[count];
     }
+  if (hval == 0)
+    ++hval;
 
   /* First hash function: simply take the modul but prevent zero. */
   idx = hval % htab->size + 1;

Modified: fsf/trunk/libc/stdio-common/psiginfo.c
==============================================================================
--- fsf/trunk/libc/stdio-common/psiginfo.c (original)
+++ fsf/trunk/libc/stdio-common/psiginfo.c Sat Apr 25 00:05:10 2009
@@ -16,6 +16,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <errno.h>
 #include <libintl.h>
 #include <signal.h>
 #include <stdint.h>