[Mesa-dev] [PATCH:mesa] util: Make xmlconfig.c build on Solaris without d_type in dirent (v2)
Roland Mainz
gisburn at gmail.com
Sat Oct 6 09:21:54 UTC 2018
On Sat, 6 Oct 2018, 01:34 Alan Coopersmith, <alan.coopersmith at oracle.com>
wrote:
> v2: check for lstat() failing
>
> Fixes: 04bdbbcab3c "xmlconfig: read more config files from drirc.d/"
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
> Reviewed-by: Roland Mainz <roland.mainz at nrubsig.org>
> Reviewed-by: Ian Romanick <ian.d.romanick at intel.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..5907c68012 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;
> +
> + if ((lstat(ent->d_name, &st) != 0) ||
> + (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)))
> + return 0;
> +#else
> if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
> return 0;
> +#endif
>
> if (fnmatch("*.conf", ent->d_name, 0))
> return 0;
>
Reviewed by roland.mainz at nrubsig.org
----
Bye,
Roland
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181006/a96cf85a/attachment-0001.html>
More information about the mesa-dev
mailing list