From patchwork Wed Sep 27 23:17:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 23186 Received: (qmail 104188 invoked by alias); 27 Sep 2017 23:26:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 104175 invoked by uid 89); 27 Sep 2017 23:26:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.2 spammy= X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [hurd, commited 3/4] hurd: Fix `seekdir' symbol exposition from `rewinddir' Date: Thu, 28 Sep 2017 01:17:41 +0200 Message-Id: <20170927231742.9050-4-samuel.thibault@ens-lyon.org> In-Reply-To: <20170927231742.9050-1-samuel.thibault@ens-lyon.org> References: <20170927231742.9050-1-samuel.thibault@ens-lyon.org> `seekdir' is MISC || XOPEN, it should not be exposed along `rewinddir' which is POSIX. * include/dirent.h (__seekdir): New declaration. * sysdeps/mach/hurd/seekdir.c (seekdir): Rename to __seekdir and redefine as weak alias. * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead of seekdir. --- ChangeLog | 5 +++++ include/dirent.h | 1 + sysdeps/mach/hurd/rewinddir.c | 2 +- sysdeps/mach/hurd/seekdir.c | 5 +++-- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff321d7e2b..737dc8f808 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,11 @@ * sysdeps/mach/hurd/revoke.c (revoke): Likewise. * sysdeps/unix/bsd/unlockpt.c (unlockpt): Use __revoke instead of revoke. + * include/dirent.h (__seekdir): New declaration. + * sysdeps/mach/hurd/seekdir.c (seekdir): Rename to __seekdir and + redefine as weak alias. + * sysdeps/mach/hurd/rewinddir.c (__rewinddir): Use __seekdir instead + of seekdir. 2017-09-26 H.J. Lu diff --git a/include/dirent.h b/include/dirent.h index 5720d589a2..d7dbf83964 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -46,6 +46,7 @@ extern int __versionsort64 (const struct dirent64 **a, extern DIR *__alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp) attribute_hidden; extern __typeof (rewinddir) __rewinddir; +extern __typeof (seekdir) __seekdir; extern __typeof (dirfd) __dirfd; extern void __scandir_cancel_handler (void *arg) attribute_hidden; diff --git a/sysdeps/mach/hurd/rewinddir.c b/sysdeps/mach/hurd/rewinddir.c index b6791d95c3..84aa87c961 100644 --- a/sysdeps/mach/hurd/rewinddir.c +++ b/sysdeps/mach/hurd/rewinddir.c @@ -24,7 +24,7 @@ void __rewinddir (DIR *dirp) { - seekdir (dirp, (off_t) 0L); + __seekdir (dirp, (off_t) 0L); } libc_hidden_def (__rewinddir) weak_alias (__rewinddir, rewinddir) diff --git a/sysdeps/mach/hurd/seekdir.c b/sysdeps/mach/hurd/seekdir.c index 8d3020b02c..68f7ce07c5 100644 --- a/sysdeps/mach/hurd/seekdir.c +++ b/sysdeps/mach/hurd/seekdir.c @@ -22,9 +22,8 @@ #include "dirstream.h" /* Seek to position POS in DIRP. */ -/* XXX should be __seekdir ? */ void -seekdir (DIR *dirp, long int pos) +__seekdir (DIR *dirp, long int pos) { __libc_lock_lock (dirp->__lock); /* Change our entry index pointer to POS and discard any data already @@ -35,3 +34,5 @@ seekdir (DIR *dirp, long int pos) dirp->__size = 0; __libc_lock_unlock (dirp->__lock); } + +weak_alias (__seekdir, seekdir)