diff options
author | Simon McVittie <smcv@debian.org> | 2016-10-01 12:38:50 +0100 |
---|---|---|
committer | Simon McVittie <smcv@debian.org> | 2016-10-13 17:20:31 +0100 |
commit | e82ec99e9232f2b05066f27559f499f2f2234f45 (patch) | |
tree | 517c49dafbad020ee3008b28533a494c3f339669 /dbus/dbus-sysdeps-unix.c | |
parent | 8db5ca900fd84ea1c055cd15600dfe352e542df5 (diff) | |
download | dbus-e82ec99e9232f2b05066f27559f499f2f2234f45.tar.gz |
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
Diffstat (limited to 'dbus/dbus-sysdeps-unix.c')
-rw-r--r-- | dbus/dbus-sysdeps-unix.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c index fda5d8e7..106a12ba 100644 --- a/dbus/dbus-sysdeps-unix.c +++ b/dbus/dbus-sysdeps-unix.c @@ -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] == '.') |