mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-02-20 23:20:35 +01:00
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 <smcv@debian.org> Reviewed-by: Thomas Zimmermann <tdz@users.sourceforge.net> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
This commit is contained in:
parent
8db5ca900f
commit
e82ec99e92
1 changed files with 4 additions and 4 deletions
|
|
@ -4341,13 +4341,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] == '.')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue