[PATCH] libdrm: Use readdir instead of readdir_r to avoid build warnings

Emil Velikov emil.l.velikov at gmail.com
Mon Mar 19 14:11:21 UTC 2018


On 19 March 2018 at 13:47, John Stultz <john.stultz at linaro.org> wrote:
> Building libdrm under AOSP, we see the following build warning:
> external/libdrm/xf86drm.c:2861:12: warning: 'readdir_r' is deprecated: readdir_r is deprecated; use readdir instead [-Wdeprecated-declarations]
>     while (readdir_r(sysdir, pent, &ent) == 0 && ent != NULL) {
>            ^
>
> Thus, this patch replaces readdir_r with readdir.
>
When C runtime suggests new behaviour before the manual/spec is updated... sigh.

readdir(3)
It is expected that a future version of POSIX.1 will require that
readdir() be thread-safe when concurrently employed on different
directory streams

readdir_r(3)
It is expected that a future version of POSIX.1 will make readdir_r()
obsolete, and require that readdir(3) be thread-safe when concurrently
employed on different directory streams.


Regardless, patch is
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

-Emil


More information about the dri-devel mailing list