[Mesa-dev] [PATCH:mesa] util: Make xmlconfig.c build on Solaris without d_type in dirent
Roland Mainz
roland.mainz at nrubsig.org
Wed Oct 3 22:15:57 UTC 2018
On Wed, Oct 3, 2018 at 11:51 PM Alan Coopersmith
<alan.coopersmith at oracle.com> wrote:
>
> Introduced-by: commit 04bdbbcab3c4862bf3f54ce60fcc1d2007776f80
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> ---
> src/util/xmlconfig.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
> index 5264f2598b..608972f812 100644
> --- a/src/util/xmlconfig.c
> +++ b/src/util/xmlconfig.c
> @@ -938,8 +938,16 @@ parseOneConfigFile(struct OptConfData *data, const char *filename)
> static int
> scandir_filter(const struct dirent *ent)
> {
> +#ifndef DT_REG /* systems without d_type in dirent results */
> + struct stat st;
> +
> + lstat(ent->d_name, &st);
> + if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode))
> + return 0;
> +#else
What about testing for the return code of |lstat()|&&|errno| before
looking at the value of |st| ?
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
More information about the mesa-dev
mailing list