From 2c7bbfaf4e361b482f3ccfbdbb29cc5121ca0ea8 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 27 Sep 2017 23:46:51 +0200 Subject: 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. --- io/ftw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'io') diff --git a/io/ftw.c b/io/ftw.c index 63448e1..6cca0e4 100644 --- a/io/ftw.c +++ b/io/ftw.c @@ -361,7 +361,7 @@ open_dir_stream (int *dfdp, struct ftw_data *data, struct dir_data *dirp) result = -1; else { - dirp->streamfd = dirfd (dirp->stream); + dirp->streamfd = __dirfd (dirp->stream); dirp->content = NULL; data->dirstreams[data->actdir] = dirp; @@ -518,7 +518,7 @@ fail: /* 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; @@ -602,7 +602,7 @@ 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) -- cgit v1.1