am edf4e179: Merge "Fix vold\'s use of readdir_r(3)."
* commit 'edf4e17940c6d3887e9009b23ffca5be8116fbe9':
Fix vold's use of readdir_r(3).
diff --git a/CommandListener.cpp b/CommandListener.cpp
index 461103e..ca871da 100644
--- a/CommandListener.cpp
+++ b/CommandListener.cpp
@@ -270,7 +270,7 @@
}
size_t dirent_len = offsetof(struct dirent, d_name) +
- pathconf(directory, _PC_NAME_MAX) + 1;
+ fpathconf(dirfd(d), _PC_NAME_MAX) + 1;
struct dirent *dent = (struct dirent *) malloc(dirent_len);
if (dent == NULL) {
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 8e3e170..a1930d1 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -1471,7 +1471,7 @@
}
size_t dirent_len = offsetof(struct dirent, d_name) +
- pathconf(directory, _PC_NAME_MAX) + 1;
+ fpathconf(dirfd(d), _PC_NAME_MAX) + 1;
struct dirent *dent = (struct dirent *) malloc(dirent_len);
if (dent == NULL) {