summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahoo-inc.com>2017-08-09 20:36:01 +0200
committerTor Egge <Tor.Egge@yahoo-inc.com>2017-08-09 20:55:25 +0200
commitb5874f24d9ce5783c5ace81bb3359b53966fff5d (patch)
tree0b119e99e8e0ab0829511393082a9937b16d1e1e /searchcore
parentc1b3fb8dce2b66857fb528da4d94ac96902e79f6 (diff)
Stop using deprecated readdir_r (deprecated since glibc 2.24).
Use readdir instead.
Diffstat (limited to 'searchcore')
-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);