summaryrefslogtreecommitdiff
path: root/tools.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-06-25 11:54:32 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2017-06-25 11:54:32 +0200
commit027ae738a87db113984d7c079db16b855e0cee3d (patch)
tree9ace36614729ac6bcb1c99fe04c3bffee9fb6673 /tools.c
parentce5e23f2097f6491f87e0fb5e72c0781975667c9 (diff)
downloadvdr-027ae738a87db113984d7c079db16b855e0cee3d.tar.gz
vdr-027ae738a87db113984d7c079db16b855e0cee3d.tar.bz2
Now using readdir() instead of readdir_r(), if GLIBC version 2.24 or newer is used
Diffstat (limited to 'tools.c')
-rw-r--r--tools.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools.c b/tools.c
index 042e56c7..ac2f9eb2 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 4.7 2017/06/23 09:39:45 kls Exp $
+ * $Id: tools.c 4.8 2017/06/25 11:45:39 kls Exp $
*/
#include "tools.h"
@@ -1528,7 +1528,11 @@ cReadDir::~cReadDir()
struct dirent *cReadDir::Next(void)
{
if (directory) {
+#if !__GLIBC_PREREQ(2, 24) // readdir_r() is deprecated as of GLIBC 2.24
while (readdir_r(directory, &u.d, &result) == 0 && result) {
+#else
+ while ((result = readdir(directory)) != NULL) {
+#endif
if (strcmp(result->d_name, ".") && strcmp(result->d_name, ".."))
return result;
}