commit
8f5238538d47e958cad2490732fbb27e7b1cd8ab
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Wed Sep 27 23:46:51 2017 +0200
hurd: Fix dirfd symbol exposition from ftw
dirfd is XOPEN2K8 only, it should not be exposed along ftw which is earlier.
* include/dirent.h (__dirfd): New declaration.
* dirent/dirfd.c (dirfd): Rename to __dirfd, and redefine as weak
alias.
* sysdeps/posix/dirfd/dirfd.c (dirfd): Likewise.
* sysdeps/mach/hurd/dirfd.c (dirfd): Likewise.
* io/ftw.c (open_dir_stream, ftw_dir): Use __dirfd instead of dirfd.
+ glob in glibc 2.26, removed later
Gbp-Pq: Topic hurd-i386
Gbp-Pq: Name git-dirfd-linknamespace.diff
#include <errno.h>
int
-dirfd (DIR *dirp)
+__dirfd (DIR *dirp)
{
__set_errno (ENOSYS);
return -1;
}
+weak_alias (__dirfd, dirfd)
stub_warning (dirfd)
const struct stat64 *statp)
internal_function attribute_hidden;
extern __typeof (rewinddir) __rewinddir;
+extern __typeof (dirfd) __dirfd;
extern void __scandir_cancel_handler (void *arg) attribute_hidden;
extern int __scandir_tail (DIR *dp,
result = -1;
else
{
- dirp->streamfd = dirfd (dirp->stream);
+ dirp->streamfd = __dirfd (dirp->stream);
dirp->content = NULL;
data->dirstreams[data->actdir] = dirp;
/* If necessary, change to this directory. */
if (data->flags & FTW_CHDIR)
{
- if (__fchdir (dirfd (dir.stream)) < 0)
+ if (__fchdir (__dirfd (dir.stream)) < 0)
{
result = -1;
goto fail;
/* Change back to the parent directory. */
int done = 0;
if (old_dir->stream != NULL)
- if (__fchdir (dirfd (old_dir->stream)) == 0)
+ if (__fchdir (__dirfd (old_dir->stream)) == 0)
done = 1;
if (!done)
else
{
int dfd = (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
- ? -1 : dirfd ((DIR *) stream));
+ ? -1 : __dirfd ((DIR *) stream));
int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
| ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0));
flags |= GLOB_MAGCHAR;
#include <errno.h>
int
-dirfd (DIR *dirp)
+__dirfd (DIR *dirp)
{
int fd;
return fd;
}
+
+weak_alias (__dirfd, dirfd)
#undef dirfd
int
-dirfd (DIR *dirp)
+__dirfd (DIR *dirp)
{
return dirp->fd;
}
+
+weak_alias (__dirfd, dirfd)