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. --- sysdeps/mach/hurd/dirfd.c | 4 +++- sysdeps/posix/dirfd.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/mach/hurd/dirfd.c b/sysdeps/mach/hurd/dirfd.c index 0ad290d515..65673336e3 100644 --- a/sysdeps/mach/hurd/dirfd.c +++ b/sysdeps/mach/hurd/dirfd.c @@ -22,7 +22,7 @@ #include int -dirfd (DIR *dirp) +__dirfd (DIR *dirp) { int fd; @@ -41,3 +41,5 @@ dirfd (DIR *dirp) return fd; } + +weak_alias (__dirfd, dirfd) diff --git a/sysdeps/posix/dirfd.c b/sysdeps/posix/dirfd.c index fee8326d93..ce779c50ae 100644 --- a/sysdeps/posix/dirfd.c +++ b/sysdeps/posix/dirfd.c @@ -22,7 +22,9 @@ #undef dirfd int -dirfd (DIR *dirp) +__dirfd (DIR *dirp) { return dirp->fd; } + +weak_alias (__dirfd, dirfd) -- cgit v1.2.3