]> Savannah Git Hosting - gnulib.git/commitdiff
glob: port to NetBSD 9.2
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 Apr 2022 21:54:26 +0000 (14:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 26 Apr 2022 21:55:45 +0000 (14:55 -0700)
Problem reported by Benno Schulenberg in:
https://lists.gnu.org/r/bug-gnulib/2022-04/msg00052.html
* doc/posix-functions/dirfd.texi: Document NetBSD 9.2 portability
bugs.  Remove an old common about errno that is no longer true
of POSIX 2018.
* lib/glob.c (glob_in_dir): Convert dirfd arg from void *
to DIR * before passing it to dirfd.

ChangeLog
doc/posix-functions/dirfd.texi
lib/glob.c

index ddd4826bcf57f6738dbd0992584543e88d5bf5a5..cccb04696d4a92a48ac5fbf09d758ae7d5d1eba5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-04-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       glob: port to NetBSD 9.2
+       Problem reported by Benno Schulenberg in:
+       https://lists.gnu.org/r/bug-gnulib/2022-04/msg00052.html
+       * doc/posix-functions/dirfd.texi: Document NetBSD 9.2 portability
+       bugs.  Remove an old common about errno that is no longer true
+       of POSIX 2018.
+       * lib/glob.c (glob_in_dir): Convert dirfd arg from void *
+       to DIR * before passing it to dirfd.
+
 2022-04-21  Paul Eggert  <eggert@cs.ucla.edu>
 
        regex: match [...---...] like V7 grep
index 46ad5fe7d421e4f1201c9146489c366663da2e53..d0f6c8cdcda9113b323cf2a4f4de34d4124e079d 100644 (file)
@@ -18,8 +18,9 @@ Portability problems not fixed by Gnulib:
 @item
 This function always fails on some platforms:
 mingw.
-@end itemize
 
-With the @code{dirfd} module, this functions always sets @code{errno} when it
-fails. (POSIX does not require that @code{dirfd} sets @code{errno} when it
-fails.)
+@item
+There is a @code{dirfd} macro but no function, and the macro does not
+work with an argument of type @code{void *}, as a function would:
+NetBSD 9.2.
+@end itemize
index f6993a3706468c79998e90353eef2392ba4bbbf9..57cb3bd1d1c862279f699ea2ed23e9d360315b0b 100644 (file)
@@ -1357,7 +1357,8 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
         }
       else
         {
-          int dfd = dirfd (stream);
+          DIR *dirp = stream;
+          int dfd = dirfd (dirp);
           int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
                            | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0));
           flags |= GLOB_MAGCHAR;