summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-08-10 12:47:17 +0200
committerGitHub <noreply@github.com>2017-08-10 12:47:17 +0200
commit4ab72997cb315f0be8200916abce5c95568634f7 (patch)
tree0b119e99e8e0ab0829511393082a9937b16d1e1e
parentc1b3fb8dce2b66857fb528da4d94ac96902e79f6 (diff)
parentb5874f24d9ce5783c5ace81bb3359b53966fff5d (diff)
Merge pull request #3065 from yahoo/toregge/stop-using-deprecated-readdir-variant
Stop using deprecated readdir_r (deprecated since glibc 2.24).
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp9
1 files 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);