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

[Commits] r15831 - in /fsf/trunk/libc: ./ hesiod/ iconv/ inet/ intl/ locale/ misc/ nis/ nptl/ nss/ nss/nss_files/ resolv/ sysdeps/posi...



Author: eglibc
Date: Wed Nov 16 00:02:10 2011
New Revision: 15831

Log:
Import glibc-mainline for 2011-11-16

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/hesiod/hesiod.c
    fsf/trunk/libc/iconv/gconv_conf.c
    fsf/trunk/libc/inet/rcmd.c
    fsf/trunk/libc/inet/ruserpass.c
    fsf/trunk/libc/intl/localealias.c
    fsf/trunk/libc/locale/loadarchive.c
    fsf/trunk/libc/locale/loadlocale.c
    fsf/trunk/libc/misc/getpass.c
    fsf/trunk/libc/misc/getttyent.c
    fsf/trunk/libc/misc/getusershell.c
    fsf/trunk/libc/misc/mntent_r.c
    fsf/trunk/libc/nis/nis_file.c
    fsf/trunk/libc/nis/nss-default.c
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/pthread_getattr_np.c
    fsf/trunk/libc/nss/nss_files/files-XXX.c
    fsf/trunk/libc/nss/nss_files/files-alias.c
    fsf/trunk/libc/nss/nss_files/files-initgroups.c
    fsf/trunk/libc/nss/nss_files/files-key.c
    fsf/trunk/libc/nss/nss_files/files-netgrp.c
    fsf/trunk/libc/nss/nsswitch.c
    fsf/trunk/libc/resolv/gethnamaddr.c
    fsf/trunk/libc/resolv/res_hconf.c
    fsf/trunk/libc/resolv/res_query.c
    fsf/trunk/libc/sysdeps/posix/getaddrinfo.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/readonly-area.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
    fsf/trunk/libc/time/getdate.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Nov 16 00:02:10 2011
@@ -1,3 +1,84 @@
+2011-11-15  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* locale/loadarchive.c (_nl_load_locale_from_archive): Open files to
+	O_CLOEXEC.
+	* locale/loadlocale.c (_nl_load_locale): Likewise.
+
+2011-11-15  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/clock_gettime.c (SYSDEP_GETTIME_CPU)
+	[__ASSUME_POSIX_CPU_TIMERS > 0]: Assign to retval and break.
+	* sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
+	(SYSCALL_GETTIME): Set errno on error.
+
+	* sysdeps/unix/sysv/linux/check_pf.c (make_request): Properly
+	count references to noai6ai_cached.
+
+2011-11-15  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* time/getdate.c (__getdate_r): Set FD_CLOEXEC for given file.
+
+	* sysdeps/unix/sysv/linux/readonly-area.c (__readonly_area): Set
+	FD_CLOEXEC for /proc/self/maps.
+
+	* sysdeps/unix/sysv/linux/getsysstats.c (phys_pages_info): Set
+	FD_CLOEXEC for /proc/meminfo.
+
+	* sysdeps/posix/getaddrinfo.c (gaiconf_init): Set FD_CLOEXEC for
+	gai.conf.
+
+	* resolv/res_query.c (res_hostalias):  Don't allow cancellation and set
+	FD_CLOEXEC for given file.
+
+	* resolv/res_hconf.c (do_init): Set FD_CLOEXEC for host.conf.
+
+	* resolv/gethnamaddr.c (_sethtent): Don't allow cancellation and set
+	FD_CLOEXEC for /etc/hosts.
+	(_gethtent): Likewise.
+
+	* nss/nsswitch.c (nss_parse_file): Set FD_CLOEXEC.
+
+	* nss/nss_files/files-netgrp.c (_nss_files_setnetgrent): Don't allow
+	cancellation and set FD_CLOEXEC for /etc/netgroup.
+
+	* nss/nss_files/files-key.c (search): Don't allow cancellation when
+	reading /etc/publickey.
+
+	* nss/nss_files/files-initgroups.c (_nss_files_initgroups_dyn): Don't
+	allow cancellation when reading /etc/group.
+
+	* nss/nss_files/files-alias.c (internal_setent): Don't allow
+	cancellation.
+	(get_next_alias): Likewise for included file.  Also set FD_CLOEXEC.
+
+	* nss/nss_files/files-XXX.c (internal_setent): Don't allow cancellation
+	when using data file.
+
+	* nis/nss-default.c (init): Set FD_CLOEXEC for /etc/default/nss.
+
+	* nis/nis_file.c (read_nis_obj): Set FD_CLOEXEC.
+	(write_nis_obj): Use "c" and "e" in fopen.
+
+	* misc/mntent_r.c (__setmntent): Also append e to fopen format.
+
+	* misc/getusershell.c (initshells): Set FD_CLOEXEC for /etc/shells.
+
+	* misc/getttyent.c (setttyent): Set FD_CLOEXEC.
+
+	* misc/getpass.c (getpass): Set FD_CLOEXEC for /dev/tty.
+
+	* intl/localealias.c (read_alias_file): Set FD_CLOEXEC for
+	locale.alias.
+
+	* inet/ruserpass.c (ruserpass): Set FD_CLOEXEC for .netrc.
+
+	* inet/rcmd.c (iruserfopen): Set FD_CLOEXEC for hosts.equiv.
+
+	* iconv/gconv_conf.c (read_conf_file): Set FD_CLOEXEC for config file.
+
+	* hesiod/hesiod.c (parse_config_file): Prevent cancellation in config
+	file parsing and set FD_CLOEXEC.
+
 2011-11-14  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	* time/tzfile.c (__tzfile_read): Use "e" in fopen call.

Modified: fsf/trunk/libc/hesiod/hesiod.c
==============================================================================
--- fsf/trunk/libc/hesiod/hesiod.c (original)
+++ fsf/trunk/libc/hesiod/hesiod.c Wed Nov 16 00:02:10 2011
@@ -278,7 +278,7 @@
 	/*
 	 * Now open and parse the file...
 	 */
-	if (!(fp = fopen(filename, "r")))
+	if (!(fp = fopen(filename, "rce")))
 		return (-1);
 
 	while (fgets(buf, sizeof(buf), fp) != NULL) {
@@ -482,7 +482,7 @@
 
 void
 __hesiod_res_set(void *context, struct __res_state *res,
-	         void (*free_res)(void *)) {
+		 void (*free_res)(void *)) {
 	struct hesiod_p *ctx = context;
 
 	if (ctx->res && ctx->free_res) {

Modified: fsf/trunk/libc/iconv/gconv_conf.c
==============================================================================
--- fsf/trunk/libc/iconv/gconv_conf.c (original)
+++ fsf/trunk/libc/iconv/gconv_conf.c Wed Nov 16 00:02:10 2011
@@ -364,7 +364,7 @@
 {
   /* Note the file is opened with cancellation in the I/O functions
      disabled.  */
-  FILE *fp = fopen (filename, "rc");
+  FILE *fp = fopen (filename, "rce");
   char *line = NULL;
   size_t line_len = 0;
   static int modcounter;

Modified: fsf/trunk/libc/inet/rcmd.c
==============================================================================
--- fsf/trunk/libc/inet/rcmd.c (original)
+++ fsf/trunk/libc/inet/rcmd.c Wed Nov 16 00:02:10 2011
@@ -149,7 +149,7 @@
 			__fxprintf(NULL, "rcmd: getaddrinfo: %s\n",
 				   gai_strerror(error));
 
-                return -1;
+		return -1;
 	}
 
 	pfd[0].events = POLLIN;
@@ -488,7 +488,7 @@
     cp = _("not regular file");
   else
     {
-      res = fopen (file, "rc");
+      res = fopen (file, "rce");
       if (!res)
 	cp = _("cannot open");
       else if (__fxstat64 (_STAT_VER, fileno (res), &st) < 0)
@@ -574,8 +574,8 @@
 
        if (hostf != NULL)
 	 {
-           isbad = __validuser2_sa (hostf, ra, ralen, luser, ruser, rhost);
-           fclose (hostf);
+	   isbad = __validuser2_sa (hostf, ra, ralen, luser, ruser, rhost);
+	   fclose (hostf);
 	 }
 
        seteuid (uid);
@@ -618,7 +618,7 @@
   case AF_INET6:
     ra.ss_family = AF_INET6;
     memcpy (&(((struct sockaddr_in6 *)&ra)->sin6_addr), raddr,
-            sizeof(struct in6_addr));
+	    sizeof(struct in6_addr));
     ralen = sizeof(struct sockaddr_in6);
     break;
   default:
@@ -778,7 +778,7 @@
 
     while (__getline (&buf, &bufsize, hostf) > 0) {
 	buf[bufsize - 1] = '\0'; /* Make sure it's terminated.  */
-        p = buf;
+	p = buf;
 
 	/* Skip empty or comment lines */
 	if (__isempty (p)) {

Modified: fsf/trunk/libc/inet/ruserpass.c
==============================================================================
--- fsf/trunk/libc/inet/ruserpass.c (original)
+++ fsf/trunk/libc/inet/ruserpass.c Wed Nov 16 00:02:10 2011
@@ -114,7 +114,7 @@
 	buf = alloca (strlen (hdir) + 8);
 
 	__stpcpy (__stpcpy (buf, hdir), "/.netrc");
-	cfile = fopen(buf, "rc");
+	cfile = fopen(buf, "rce");
 	if (cfile == NULL) {
 		if (errno != ENOENT)
 			warn("%s", buf);

Modified: fsf/trunk/libc/intl/localealias.c
==============================================================================
--- fsf/trunk/libc/intl/localealias.c (original)
+++ fsf/trunk/libc/intl/localealias.c Wed Nov 16 00:02:10 2011
@@ -221,7 +221,7 @@
 
   /* Note the file is opened with cancellation in the I/O functions
      disabled.  */
-  fp = fopen (full_fname, "rc");
+  fp = fopen (full_fname, "rce");
   freea (full_fname);
   if (fp == NULL)
     return 0;

Modified: fsf/trunk/libc/locale/loadarchive.c
==============================================================================
--- fsf/trunk/libc/locale/loadarchive.c (original)
+++ fsf/trunk/libc/locale/loadarchive.c Wed Nov 16 00:02:10 2011
@@ -1,5 +1,5 @@
 /* Code to load locale data from the locale archive file.
-   Copyright (C) 2002, 2003, 2005, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2005, 2010, 2011 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
@@ -203,7 +203,7 @@
       archmapped = &headmap;
 
       /* The archive has never been opened.  */
-      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
       if (fd < 0)
 	/* Cannot open the archive, for whatever reason.  */
 	return NULL;
@@ -394,7 +394,8 @@
 	  if (fd == -1)
 	    {
 	      struct stat64 st;
-	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+	      fd = open_not_cancel_2 (archfname,
+				      O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 	      if (fd == -1)
 		/* Cannot open the archive, for whatever reason.  */
 		return NULL;

Modified: fsf/trunk/libc/locale/loadlocale.c
==============================================================================
--- fsf/trunk/libc/locale/loadlocale.c (original)
+++ fsf/trunk/libc/locale/loadlocale.c Wed Nov 16 00:02:10 2011
@@ -1,5 +1,5 @@
 /* Functions to read locale data files.
-   Copyright (C) 1996-2004, 2005, 2006, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1996-2004, 2005, 2006, 2010, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -173,7 +173,7 @@
   file->decided = 1;
   file->data = NULL;
 
-  fd = open_not_cancel_2 (file->filename, O_RDONLY);
+  fd = open_not_cancel_2 (file->filename, O_RDONLY | O_CLOEXEC);
   if (__builtin_expect (fd, 0) < 0)
     /* Cannot open the file.  */
     return;
@@ -201,7 +201,7 @@
 		 _nl_category_names.str + _nl_category_name_idxs[category],
 		 _nl_category_name_sizes[category] + 1);
 
-      fd = open_not_cancel_2 (newp, O_RDONLY);
+      fd = open_not_cancel_2 (newp, O_RDONLY | O_CLOEXEC);
       if (__builtin_expect (fd, 0) < 0)
 	return;
 

Modified: fsf/trunk/libc/misc/getpass.c
==============================================================================
--- fsf/trunk/libc/misc/getpass.c (original)
+++ fsf/trunk/libc/misc/getpass.c Wed Nov 16 00:02:10 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992-1999,2001,2003,2004,2005 Free Software Foundation, Inc.
+/* Copyright (C) 1992-1999,2001,2003-2005,2011 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
@@ -57,7 +57,7 @@
   /* Try to write to and read from the terminal if we can.
      If we can't open the terminal, use stderr and stdin.  */
 
-  in = fopen ("/dev/tty", "w+c");
+  in = fopen ("/dev/tty", "w+ce");
   if (in == NULL)
     {
       in = stdin;

Modified: fsf/trunk/libc/misc/getttyent.c
==============================================================================
--- fsf/trunk/libc/misc/getttyent.c (original)
+++ fsf/trunk/libc/misc/getttyent.c Wed Nov 16 00:02:10 2011
@@ -190,7 +190,7 @@
 	if (tf) {
 		(void)rewind(tf);
 		return (1);
-	} else if ((tf = fopen(_PATH_TTYS, "rc"))) {
+	} else if ((tf = fopen(_PATH_TTYS, "rce"))) {
 		/* We do the locking ourselves.  */
 		__fsetlocking (tf, FSETLOCKING_BYCALLER);
 		return (1);

Modified: fsf/trunk/libc/misc/getusershell.c
==============================================================================
--- fsf/trunk/libc/misc/getusershell.c (original)
+++ fsf/trunk/libc/misc/getusershell.c Wed Nov 16 00:02:10 2011
@@ -104,7 +104,7 @@
 	shells = NULL;
 	free(strings);
 	strings = NULL;
-	if ((fp = fopen(_PATH_SHELLS, "rc")) == NULL)
+	if ((fp = fopen(_PATH_SHELLS, "rce")) == NULL)
 		goto init_okshells_noclose;
 	if (fstat64(fileno(fp), &statb) == -1) {
 	init_okshells:

Modified: fsf/trunk/libc/misc/mntent_r.c
==============================================================================
--- fsf/trunk/libc/misc/mntent_r.c (original)
+++ fsf/trunk/libc/misc/mntent_r.c Wed Nov 16 00:02:10 2011
@@ -38,10 +38,10 @@
 __setmntent (const char *file, const char *mode)
 {
   /* Extend the mode parameter with "c" to disable cancellation in the
-     I/O functions.  */
+     I/O functions and "e" to set FD_CLOEXEC.  */
   size_t modelen = strlen (mode);
-  char newmode[modelen + 2];
-  memcpy (mempcpy (newmode, mode, modelen), "c", 2);
+  char newmode[modelen + 3];
+  memcpy (mempcpy (newmode, mode, modelen), "ce", 3);
   FILE *result = fopen (file, newmode);
 
   if (result != NULL)

Modified: fsf/trunk/libc/nis/nis_file.c
==============================================================================
--- fsf/trunk/libc/nis/nis_file.c (original)
+++ fsf/trunk/libc/nis/nis_file.c Wed Nov 16 00:02:10 2011
@@ -1,4 +1,4 @@
-/* Copyright (c) 1997, 1998, 1999, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (c) 1997, 1998, 1999, 2004, 2005, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@xxxxxxx>, 1997.
 
@@ -31,7 +31,7 @@
 read_nis_obj (const char *name, iofct_t readfct, freefct_t freefct,
 	      size_t objsize)
 {
-  FILE *in = fopen (name, "rc");
+  FILE *in = fopen (name, "rce");
   if (in == NULL)
     return NULL;
 
@@ -59,7 +59,7 @@
 static bool_t
 write_nis_obj (const char *name, const void *obj, iofct_t writefct)
 {
-  FILE *out = fopen (name, "w");
+  FILE *out = fopen (name, "wce");
   if (out == NULL)
     return FALSE;
 

Modified: fsf/trunk/libc/nis/nss-default.c
==============================================================================
--- fsf/trunk/libc/nis/nss-default.c (original)
+++ fsf/trunk/libc/nis/nss-default.c Wed Nov 16 00:02:10 2011
@@ -1,4 +1,5 @@
-/* Copyright (C) 1996,2001,2004,2006,2007,2010 Free Software Foundation, Inc.
+/* Copyright (C) 1996,2001,2004,2006,2007,2010,2011
+   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
@@ -57,7 +58,7 @@
 init (void)
 {
   int saved_errno = errno;
-  FILE *fp = fopen (default_nss, "rc");
+  FILE *fp = fopen (default_nss, "rce");
   if (fp != NULL)
     {
       char *line = NULL;

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Wed Nov 16 00:02:10 2011
@@ -1,3 +1,8 @@
+2011-11-15  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* pthread_getattr_np.c (pthread_getattr_np): Set FD_CLOEXEC for
+	/proc/self/maps.
+
 2011-10-29  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	[BZ #13358]

Modified: fsf/trunk/libc/nptl/pthread_getattr_np.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_getattr_np.c (original)
+++ fsf/trunk/libc/nptl/pthread_getattr_np.c Wed Nov 16 00:02:10 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004, 2006, 2007, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -75,7 +75,7 @@
       /* The safest way to get the top of the stack is to read
 	 /proc/self/maps and locate the line into which
 	 __libc_stack_end falls.  */
-      FILE *fp = fopen ("/proc/self/maps", "rc");
+      FILE *fp = fopen ("/proc/self/maps", "rce");
       if (fp == NULL)
 	ret = errno;
       /* We need the limit of the stack in any case.  */
@@ -164,7 +164,7 @@
 	{
 	  free (cpuset);
 	  if (ret == ENOSYS)
-	    {	  
+	    {
 	      /* There is no such functionality.  */
 	      ret = 0;
 	      iattr->cpuset = NULL;

Modified: fsf/trunk/libc/nss/nss_files/files-XXX.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-XXX.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-XXX.c Wed Nov 16 00:02:10 2011
@@ -77,7 +77,7 @@
 
   if (stream == NULL)
     {
-      stream = fopen (DATAFILE, "re");
+      stream = fopen (DATAFILE, "rce");
 
       if (stream == NULL)
 	status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;

Modified: fsf/trunk/libc/nss/nss_files/files-alias.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-alias.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-alias.c Wed Nov 16 00:02:10 2011
@@ -48,7 +48,7 @@
 
   if (stream == NULL)
     {
-      stream = fopen ("/etc/aliases", "re");
+      stream = fopen ("/etc/aliases", "rce");
 
       if (stream == NULL)
 	status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
@@ -258,7 +258,7 @@
 
 		      first_unused = cp;
 
-		      listfile = fopen (&cp[9], "r");
+		      listfile = fopen (&cp[9], "rce");
 		      /* If the file does not exist we simply ignore
 			 the statement.  */
 		      if (listfile != NULL

Modified: fsf/trunk/libc/nss/nss_files/files-initgroups.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-initgroups.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-initgroups.c Wed Nov 16 00:02:10 2011
@@ -30,7 +30,7 @@
 			   long int *size, gid_t **groupsp, long int limit,
 			   int *errnop)
 {
-  FILE *stream = fopen ("/etc/group", "re");
+  FILE *stream = fopen ("/etc/group", "rce");
   if (stream == NULL)
     {
       *errnop = errno;

Modified: fsf/trunk/libc/nss/nss_files/files-key.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-key.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-key.c Wed Nov 16 00:02:10 2011
@@ -33,7 +33,7 @@
 static enum nss_status
 search (const char *netname, char *result, int *errnop, int secret)
 {
-  FILE *stream = fopen (DATAFILE, "re");
+  FILE *stream = fopen (DATAFILE, "rce");
   if (stream == NULL)
     return errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
 

Modified: fsf/trunk/libc/nss/nss_files/files-netgrp.c
==============================================================================
--- fsf/trunk/libc/nss/nss_files/files-netgrp.c (original)
+++ fsf/trunk/libc/nss/nss_files/files-netgrp.c Wed Nov 16 00:02:10 2011
@@ -1,5 +1,5 @@
 /* Netgroup file parser in nss_files modules.
-   Copyright (C) 1996, 1997, 2000, 2004, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1997, 2000, 2004, 2005, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 1996.
 
@@ -63,7 +63,7 @@
     return NSS_STATUS_UNAVAIL;
 
   /* Find the netgroups file and open it.  */
-  fp = fopen (DATAFILE, "r");
+  fp = fopen (DATAFILE, "rce");
   if (fp == NULL)
     status = errno == EAGAIN ? NSS_STATUS_TRYAGAIN : NSS_STATUS_UNAVAIL;
   else

Modified: fsf/trunk/libc/nss/nsswitch.c
==============================================================================
--- fsf/trunk/libc/nss/nsswitch.c (original)
+++ fsf/trunk/libc/nss/nsswitch.c Wed Nov 16 00:02:10 2011
@@ -503,7 +503,7 @@
   size_t len;
 
   /* Open the configuration file.  */
-  fp = fopen (fname, "rc");
+  fp = fopen (fname, "rce");
   if (fp == NULL)
     return NULL;
 

Modified: fsf/trunk/libc/resolv/gethnamaddr.c
==============================================================================
--- fsf/trunk/libc/resolv/gethnamaddr.c (original)
+++ fsf/trunk/libc/resolv/gethnamaddr.c Wed Nov 16 00:02:10 2011
@@ -585,7 +585,7 @@
 			}
 			if (!isdigit(*cp) && *cp != '.')
 				break;
-               }
+	       }
 	if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
 	    name[0] == ':')
 		for (cp = name;; ++cp) {
@@ -787,7 +787,7 @@
 	int f;
 {
 	if (!hostf)
-		hostf = fopen(_PATH_HOSTS, "r" );
+		hostf = fopen(_PATH_HOSTS, "rce" );
 	else
 		rewind(hostf);
 	stayopen = f;
@@ -810,7 +810,7 @@
 	register char *cp, **q;
 	int af, len;
 
-	if (!hostf && !(hostf = fopen(_PATH_HOSTS, "r" ))) {
+	if (!hostf && !(hostf = fopen(_PATH_HOSTS, "rce" ))) {
 		__set_h_errno (NETDB_INTERNAL);
 		return (NULL);
 	}

Modified: fsf/trunk/libc/resolv/res_hconf.c
==============================================================================
--- fsf/trunk/libc/resolv/res_hconf.c (original)
+++ fsf/trunk/libc/resolv/res_hconf.c Wed Nov 16 00:02:10 2011
@@ -307,7 +307,7 @@
   if (hconf_name == NULL)
     hconf_name = _PATH_HOSTCONF;
 
-  fp = fopen (hconf_name, "rc");
+  fp = fopen (hconf_name, "rce");
   if (fp)
     {
       /* No threads using this stream.  */

Modified: fsf/trunk/libc/resolv/res_query.c
==============================================================================
--- fsf/trunk/libc/resolv/res_query.c (original)
+++ fsf/trunk/libc/resolv/res_query.c Wed Nov 16 00:02:10 2011
@@ -602,7 +602,7 @@
 	if (statp->options & RES_NOALIASES)
 		return (NULL);
 	file = getenv("HOSTALIASES");
-	if (file == NULL || (fp = fopen(file, "r")) == NULL)
+	if (file == NULL || (fp = fopen(file, "rce")) == NULL)
 		return (NULL);
 	setbuf(fp, NULL);
 	buf[sizeof(buf) - 1] = '\0';

Modified: fsf/trunk/libc/sysdeps/posix/getaddrinfo.c
==============================================================================
--- fsf/trunk/libc/sysdeps/posix/getaddrinfo.c (original)
+++ fsf/trunk/libc/sysdeps/posix/getaddrinfo.c Wed Nov 16 00:02:10 2011
@@ -1958,7 +1958,7 @@
   size_t nscopelist = 0;
   bool scopelist_nullbits = false;
 
-  FILE *fp = fopen (GAICONF_FNAME, "rc");
+  FILE *fp = fopen (GAICONF_FNAME, "rce");
   if (fp != NULL)
     {
       struct stat64 st;

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/check_pf.c Wed Nov 16 00:02:10 2011
@@ -58,7 +58,7 @@
 
 static struct cached_data noai6ai_cached =
   {
-    .usecnt = 3,	/* Make sure we never try to delete this entry.  */
+    .usecnt = 1,	/* Make sure we never try to delete this entry.  */
     .in6ailen = 0
   };
 
@@ -273,6 +273,7 @@
     }
   else
     {
+      atomic_add (&noai6ai_cached.usecnt, 2);
       noai6ai_cached.seen_ipv4 = seen_ipv4;
       noai6ai_cached.seen_ipv6 = seen_ipv6;
       result = &noai6ai_cached;

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/clock_gettime.c Wed Nov 16 00:02:10 2011
@@ -110,7 +110,9 @@
 
 # if __ASSUME_POSIX_CPU_TIMERS > 0
 
-#  define SYSDEP_GETTIME_CPU SYSCALL_GETTIME
+#  define SYSDEP_GETTIME_CPU(clock_id, tp) \
+  retval = SYSCALL_GETTIME (clock_id, tp); \
+  break
 #  define SYSDEP_GETTIME_CPUTIME	/* Default catches them too.  */
 
 # else

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/getsysstats.c Wed Nov 16 00:02:10 2011
@@ -296,7 +296,7 @@
   long int result = -1;
 
   /* If we haven't found an appropriate entry return 1.  */
-  FILE *fp = fopen ("/proc/meminfo", "rc");
+  FILE *fp = fopen ("/proc/meminfo", "rce");
   if (fp != NULL)
     {
       /* No threads use this stream.  */

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/readonly-area.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/readonly-area.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/readonly-area.c Wed Nov 16 00:02:10 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2004, 2005, 2011 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
@@ -32,7 +32,7 @@
 {
   const void *ptr_end = ptr + size;
 
-  FILE *fp = fopen ("/proc/self/maps", "rc");
+  FILE *fp = fopen ("/proc/self/maps", "rce");
   if (fp == NULL)
     {
       /* It is the system administrator's choice to not have /proc

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c Wed Nov 16 00:02:10 2011
@@ -3,8 +3,14 @@
 #ifdef SHARED
 # define SYSCALL_GETTIME(id, tp) \
   ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+  long int v_ret;							  \
   PTR_DEMANGLE (f);							  \
-  f (id, tp); })
+  v_ret = f (id, tp);							  \
+  if (INTERNAL_SYSCALL_ERROR_P (v_ret, )) {				  \
+    __set_errno (INTERNAL_SYSCALL_ERRNO (v_ret, ));			  \
+    v_ret = -1;								  \
+  }									  \
+  v_ret; })
 # define INTERNAL_GETTIME(id, tp) \
   ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
   PTR_DEMANGLE (f);							  \

Modified: fsf/trunk/libc/time/getdate.c
==============================================================================
--- fsf/trunk/libc/time/getdate.c (original)
+++ fsf/trunk/libc/time/getdate.c Wed Nov 16 00:02:10 2011
@@ -1,5 +1,5 @@
 /* Convert a string representation of time to a time value.
-   Copyright (C) 1997,1998,1999,2000,2001,2003 Free Software Foundation, Inc.
+   Copyright (C) 1997-2001,2003,2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Mark Kettenis <kettenis@xxxxxxxxxxx>, 1997.
 
@@ -44,7 +44,7 @@
      6  memory allication failed (not enough memory available),
      7  there is no line in the template that matches the input,
      8  invalid input specification Example: February 31 or a time is
-        specified that can not be represented in a time_t (representing
+	specified that can not be represented in a time_t (representing
 	the time in seconds since 00:00:00 UTC, January 1, 1970) */
 int getdate_err;
 
@@ -129,7 +129,7 @@
     return 2;
 
   /* Open the template file.  */
-  fp = fopen (datemsk, "rc");
+  fp = fopen (datemsk, "rce");
   if (fp == NULL)
     return 2;
 

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits