changeset 19121:b8057730207a

Merge branch 'master' of git.sv.gnu.org:/srv/git/gnulib into pygnulib
author Dmitry Selyutin <ghostmansd@gmail.com>
date Sat, 02 Sep 2017 20:54:52 +0300
parents e403a9f20de3 (current diff) cf6620fbffbc (diff)
children cb08b44bfe6b
files
diffstat 3 files changed, 30 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Sep 02 20:51:27 2017 +0300
+++ b/ChangeLog	Sat Sep 02 20:54:52 2017 +0300
@@ -1,3 +1,19 @@
+2017-09-02  Bruno Haible  <bruno@clisp.org>
+
+	dirent: Update doc.
+	* doc/posix-headers/dirent.texi: More concrete list of platforms.
+
+2017-09-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+	glob: fix getpwnam_r errno typo
+	* lib/glob.c (glob): Fix longstanding misuse of errno after
+	getpwnam_r, which returns an error number rather than setting
+	errno.
+
+	glob: fix typo in recent change
+	* lib/glob.c (glob) [!HAVE_GETPWNAM_R && !_LIBC]:
+	Fix recently-introduced typo.
+
 2017-09-02  Paul Eggert  <eggert@cs.ucla.edu>
 
 	glob: don't save and restore errno unnecessarily
--- a/doc/posix-headers/dirent.texi	Sat Sep 02 20:51:27 2017 +0300
+++ b/doc/posix-headers/dirent.texi	Sat Sep 02 20:54:52 2017 +0300
@@ -9,7 +9,8 @@
 @itemize
 @item
 The type @code{ino_t} is missing on some platforms:
-glibc 2.8 and others.
+glibc 2.23 and others.
+
 @end itemize
 
 Portability problems not fixed by Gnulib:
@@ -21,8 +22,8 @@
 @item
 Although many systems define a @code{struct dirent} member named
 @code{d_type} and directory entry type macros like @code{DT_DIR} and
-@code{DT_LINK}, some do not:
-AIX 7.2, HP-UX 11, Solaris 11, probably others.
+@code{DT_LNK}, some do not:
+Minix 3.1.8, AIX 7.2, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 11 2011-11, mingw, Interix 3.5, BeOS.
 
 @item
 On systems with @code{d_type}, not every filesystem supports
@@ -30,12 +31,16 @@
 
 @item
 Some systems define a @code{struct dirent} member named @code{d_namlen}
-containing the string length of @code{d_name}, but others do not.
+containing the string length of @code{d_name}, but others do not:
+glibc 2.23 on Linux, Minix 3.1.8, Solaris 11 2011-11, Cygwin, BeOS.
+All of these, except Cygwin, have a member @code{d_reclen} instead,
+that has a different semantics.
 
 @item
 Some systems define a @code{struct dirent} member named @code{d_off}
 containing a magic cookie suitable as an argument to @code{seekdir},
-but others do not.
+but others do not:
+glibc 2.23 on Hurd, Mac OS X 10.5, FreeBSD 6.0, NetBSD 5.0, OpenBSD 3.8, AIX 5.1, HP-UX 11, OSF/1 5.1, Cygwin, mingw, Interix 3.5, BeOS.
 
 @item
 Some systems define a @code{struct dirent} member named
--- a/lib/glob.c	Sat Sep 02 20:51:27 2017 +0300
+++ b/lib/glob.c	Sat Sep 02 20:54:52 2017 +0300
@@ -644,13 +644,8 @@
 
                   while (getpwnam_r (name, &pwbuf,
                                      pwtmpbuf.data, pwtmpbuf.length, &p)
-                         != 0)
+                         == ERANGE)
                     {
-                      if (errno != ERANGE)
-                        {
-                          p = NULL;
-                          break;
-                        }
                       if (!scratch_buffer_grow (&pwtmpbuf))
                         {
                           retval = GLOB_NOSPACE;
@@ -658,7 +653,7 @@
                         }
                     }
 # else
-                  p = getpwnam (pwtmpbuf.data);
+                  p = getpwnam (name);
 # endif
                   if (p != NULL)
                     {
@@ -815,13 +810,9 @@
             struct passwd pwbuf;
 
             while (getpwnam_r (user_name, &pwbuf,
-                               pwtmpbuf.data, pwtmpbuf.length, &p) != 0)
+                               pwtmpbuf.data, pwtmpbuf.length, &p)
+                   == ERANGE)
               {
-                if (errno != ERANGE)
-                  {
-                    p = NULL;
-                    break;
-                  }
                 if (!scratch_buffer_grow (&pwtmpbuf))
                   {
                     retval = GLOB_NOSPACE;