[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r7869 - in /fsf/trunk/libc: ./ include/rpc/ intl/ sunrpc/ sysdeps/unix/ time/
- To: commits@xxxxxxxxxx
- Subject: [commits] r7869 - in /fsf/trunk/libc: ./ include/rpc/ intl/ sunrpc/ sysdeps/unix/ time/
- From: eglibc@xxxxxxxxxx
- Date: Fri, 06 Feb 2009 08:03:47 -0000
Author: eglibc
Date: Fri Feb 6 00:03:46 2009
New Revision: 7869
Log:
Import glibc-mainline for 2009-02-06
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/include/rpc/auth.h
fsf/trunk/libc/intl/dcigettext.c
fsf/trunk/libc/sunrpc/rpc_common.c
fsf/trunk/libc/sysdeps/unix/opendir.c
fsf/trunk/libc/time/tzset.c
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri Feb 6 00:03:46 2009
@@ -1,3 +1,21 @@
+2009-02-05 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * include/rpc/auth.h: Use libc_hidden_proto for _null_auth.
+ * sunrpc/rpc_common.c: Add libc_hidden_def for _null_auth. Also
+ move _null_auth to .rodata.
+
+ * time/tzset.c (__tzset_parse_tz): DST offset must also allow hour
+ value of 24.
+
+ * intl/dcigettext.c (DCIGETTEXT): Avoid some code duplication.
+
+ * sysdeps/unix/opendir.c (__alloc_dir): We have a lot more memory
+ today than when the original code was written. Use larger
+ buffers. This also makes it unnecessary to have stat information,
+ if this causes extra efforts.
+ (__opendir): In case O_DIRECTORY works, don't call fstat just for
+ __alloc_dir.
+
2009-02-03 Andrew Stubbs <ams@xxxxxxxxxxxxxxxx>
* sysdeps/sh/sh4/dl-trampoline.S: Only set HAVE_FPU if __SH_FPU_ANY__
Modified: fsf/trunk/libc/include/rpc/auth.h
==============================================================================
--- fsf/trunk/libc/include/rpc/auth.h (original)
+++ fsf/trunk/libc/include/rpc/auth.h Fri Feb 6 00:03:46 2009
@@ -39,4 +39,6 @@
libc_hidden_proto (key_encryptsession_pk)
libc_hidden_proto (key_decryptsession_pk)
+libc_hidden_proto (_null_auth)
+
#endif
Modified: fsf/trunk/libc/intl/dcigettext.c
==============================================================================
--- fsf/trunk/libc/intl/dcigettext.c (original)
+++ fsf/trunk/libc/intl/dcigettext.c Fri Feb 6 00:03:46 2009
@@ -1,5 +1,5 @@
/* Implementation of the internal dcigettext function.
- Copyright (C) 1995-2005, 2006, 2007, 2008
+ Copyright (C) 1995-2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -553,18 +553,7 @@
}
if (ret == NULL)
- {
- /* We cannot get the current working directory. Don't signal an
- error but simply return the default string. */
- FREE_BLOCKS (block_list);
- __libc_rwlock_unlock (__libc_setlocale_lock);
- __libc_rwlock_unlock (_nl_state_lock);
- __set_errno (saved_errno);
- return (plural == 0
- ? (char *) msgid1
- /* Use the Germanic plural rule. */
- : n == 1 ? (char *) msgid1 : (char *) msgid2);
- }
+ goto no_translation;
stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
}
Modified: fsf/trunk/libc/sunrpc/rpc_common.c
==============================================================================
--- fsf/trunk/libc/sunrpc/rpc_common.c (original)
+++ fsf/trunk/libc/sunrpc/rpc_common.c Fri Feb 6 00:03:46 2009
@@ -39,7 +39,11 @@
* This file should only contain common data (global data) that is exported
* by public interfaces
*/
-struct opaque_auth _null_auth;
+/* We are very tricky here. We want to have _null_auth in a read-only
+ section but we cannot add const to the type because this isn't how
+ the variable is declared. So we use the section attribute. */
+struct opaque_auth _null_auth __attribute__ ((nocommon, section (".rodata")));
+libc_hidden_def (_null_auth)
fd_set svc_fdset;
struct rpc_createerr rpc_createerr;
struct pollfd *svc_pollfd;
Modified: fsf/trunk/libc/sysdeps/unix/opendir.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/opendir.c (original)
+++ fsf/trunk/libc/sysdeps/unix/opendir.c Fri Feb 6 00:03:46 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1996,98,2000-2003,2005,2007
+/* Copyright (C) 1991-1996,98,2000-2003,2005,2007,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -81,6 +81,7 @@
__opendir (const char *name)
{
struct stat64 statbuf;
+ struct stat64 *statp = NULL;
if (__builtin_expect (name[0], '\1') == '\0')
{
@@ -119,16 +120,14 @@
if (__builtin_expect (fd, 0) < 0)
return NULL;
- /* Now make sure this really is a directory and nothing changed since
- the `stat' call. We do not have to perform the test for the
- descriptor being associated with a directory if we know the
- O_DIRECTORY flag is honored by the kernel. */
- if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
- goto lose;
#ifdef O_DIRECTORY
if (o_directory_works <= 0)
#endif
{
+ /* Now make sure this really is a directory and nothing changed since
+ the `stat' call. */
+ if (__builtin_expect (__fxstat64 (_STAT_VER, fd, &statbuf), 0) < 0)
+ goto lose;
if (__builtin_expect (! S_ISDIR (statbuf.st_mode), 0))
{
__set_errno (ENOTDIR);
@@ -136,9 +135,10 @@
close_not_cancel_no_status (fd);
return NULL;
}
- }
-
- return __alloc_dir (fd, true, &statbuf);
+ statp = &statbuf;
+ }
+
+ return __alloc_dir (fd, true, statp);
}
weak_alias (__opendir, opendir)
@@ -171,29 +171,23 @@
goto lose;
}
- const size_t default_allocation = (BUFSIZ < sizeof (struct dirent64)
- ? sizeof (struct dirent64) : BUFSIZ);
- size_t allocation;
+ const size_t default_allocation = (4 * BUFSIZ < sizeof (struct dirent64)
+ ? sizeof (struct dirent64) : 4 * BUFSIZ);
+ const size_t small_allocation = (BUFSIZ < sizeof (struct dirent64)
+ ? sizeof (struct dirent64) : BUFSIZ);
+ size_t allocation = default_allocation;
#ifdef _STATBUF_ST_BLKSIZE
- if (__builtin_expect ((size_t) statp->st_blksize >= sizeof (struct dirent64),
- 1))
+ if (statp != NULL && default_allocation < statp->st_blksize)
allocation = statp->st_blksize;
- else
-#endif
- allocation = default_allocation;
+#endif
DIR *dirp = (DIR *) malloc (sizeof (DIR) + allocation);
if (dirp == NULL)
{
-#ifdef _STATBUF_ST_BLKSIZE
- if (allocation == statp->st_blksize
- && allocation != default_allocation)
- {
- allocation = default_allocation;
- dirp = (DIR *) malloc (sizeof (DIR) + allocation);
- }
+ allocation = small_allocation;
+ dirp = (DIR *) malloc (sizeof (DIR) + allocation);
+
if (dirp == NULL)
-#endif
lose:
{
if (close_fd)
Modified: fsf/trunk/libc/time/tzset.c
==============================================================================
--- fsf/trunk/libc/time/tzset.c (original)
+++ fsf/trunk/libc/time/tzset.c Fri Feb 6 00:03:46 2009
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002,2003,2004,2007 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2002,2003,2004,2007,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
@@ -244,7 +244,7 @@
ss = 0;
case 3:
tz_rules[1].offset *= (min (ss, 59) + (min (mm, 59) * 60) +
- (min (hh, 23) * (60 * 60)));
+ (min (hh, 24) * (60 * 60)));
break;
}
for (l = 0; l < 3; ++l)