From 721b634076654e8b0a70fe0068ec0239b07e0a5a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 1 Oct 2016 12:38:50 +0100 Subject: [PATCH 8/9] Linux: use readdir(), not deprecated readdir_r() glibc >= 2.24 marks readdir_r() as deprecated. It is meant to be a thread-safe version of readdir(), but modern implementations of readdir() are thread-safe anyway (when called with a distinct DIR * argument), and readdir_r() has some design issues involving PATH_MAX. This code path is in Linux-specific code, so we can safely assume a high-quality implementation of readdir(). Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357 --- dbus/dbus-sysdeps-unix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index 5efde59..d7f0454 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -4336,13 +4336,13 @@ _dbus_close_all (void) { for (;;) { - struct dirent buf, *de; - int k, fd; + struct dirent *de; + int fd; long l; char *e = NULL; - k = readdir_r (d, &buf, &de); - if (k != 0 || !de) + de = readdir (d); + if (!de) break; if (de->d_name[0] == '.') -- 2.9.3