On 9 February 2017 at 23:05, Timothy Arceri <[email protected]> wrote:
> d_type is not supported on all systems.
>
> Tested-by: Vinson Lee <[email protected]>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97967
CC: "13.0 17.0" <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>

> @@ -473,7 +474,7 @@ choose_random_file_matching(const char *dir_path,
>        entry = readdir(dir);
>        if (entry == NULL)
>           break;
> -      if (! predicate(entry))
> +      if (!predicate(entry, dir_path))
>           continue;
>        if (count == victim)
>           break;
Thinking out loud:
We don't need to walk over the directory (cut down the
asprintf/stat/strcmp) twice if we pick a pseudo-random file ;-)

-Emil
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to