From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 112393 invoked by alias); 1 Feb 2019 09:40:02 -0000 Mailing-List: contact newlib-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-cvs-owner@sourceware.org Received: (qmail 112367 invoked by uid 10080); 1 Feb 2019 09:40:02 -0000 Date: Fri, 01 Feb 2019 09:40:00 -0000 Message-ID: <20190201094002.112366.qmail@sourceware.org> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] scandir: Add support for struct dirent::d_type X-Act-Checkin: newlib-cygwin X-Git-Author: Sebastian Huber X-Git-Refname: refs/heads/master X-Git-Oldrev: 67613cbbd87b5b3c5b10209e6272fc8ec6405b26 X-Git-Newrev: 3e24fbf6f0e4915efbbd98702e4801bcf9ebf89a X-SW-Source: 2019-q1/txt/msg00022.txt.bz2 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3e24fbf6f0e4915efbbd98702e4801bcf9ebf89a commit 3e24fbf6f0e4915efbbd98702e4801bcf9ebf89a Author: Sebastian Huber Date: Thu Jan 31 11:48:12 2019 +0100 scandir: Add support for struct dirent::d_type Signed-off-by: Sebastian Huber Diff: --- newlib/libc/posix/scandir.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/newlib/libc/posix/scandir.c b/newlib/libc/posix/scandir.c index c39d9a4..7fd0089 100644 --- a/newlib/libc/posix/scandir.c +++ b/newlib/libc/posix/scandir.c @@ -33,7 +33,7 @@ #include __SCCSID("@(#)scandir.c 8.3 (Berkeley) 1/2/94"); -__FBSDID("$FreeBSD$"); +__FBSDID("$FreeBSD: head/lib/libc/gen/scandir.c 335898 2018-07-03 17:31:45Z jhb $"); /* * Scan the directory dirname calling select to make a list of selected @@ -95,6 +95,9 @@ scandir(const char *dirname, struct dirent ***namelist, if (p == NULL) goto fail; p->d_ino = d->d_ino; +#ifdef DT_UNKNOWN + p->d_type = d->d_type; +#endif p->d_reclen = d->d_reclen; #ifdef _DIRENT_HAVE_D_NAMLEN p->d_namlen = d->d_namlen;