From b5874f24d9ce5783c5ace81bb3359b53966fff5d Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Wed, 9 Aug 2017 20:36:01 +0200 Subject: Stop using deprecated readdir_r (deprecated since glibc 2.24). Use readdir instead. --- searchcore/src/vespa/searchcore/proton/server/proton.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index 1214bb15b07..a5b0cfd1d53 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -689,11 +689,10 @@ int countOpenFiles() int count = 0; DIR *dp = opendir(fd_dir_name); if (dp != NULL) { - struct dirent entry; - struct dirent *ptr = &entry; - while (readdir_r(dp, &entry, &ptr) == 0 && ptr != NULL) { - if (strcmp(".", entry.d_name) == 0) continue; - if (strcmp("..", entry.d_name) == 0) continue; + struct dirent *ptr; + while ((ptr = readdir(dp)) != nullptr) { + if (strcmp(".", ptr->d_name) == 0) continue; + if (strcmp("..", ptr->d_name) == 0) continue; ++count; } closedir(dp); -- cgit v1.2.3