summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaqib Khan <khansa@us.ibm.com>2017-03-02 09:22:02 -0600
committerPatrick Williams <patrick@stwcx.xyz>2017-03-03 14:33:34 +0000
commit23d4a7ecf277ff54fc5c6daaff0dc593e0596b25 (patch)
treedd0a637501446a7eec220aaf4dc4d5384773b402
parent9ca659f96268c0db1a3a8fbaa85a5aa69e6fcae9 (diff)
downloadphosphor-hwmon-23d4a7ecf277ff54fc5c6daaff0dc593e0596b25.tar.gz
phosphor-hwmon-23d4a7ecf277ff54fc5c6daaff0dc593e0596b25.zip
Replace readdir_r with readdir since readdir_r was deprecated
The updated yocto version doesn't support the recently deprecated readdir_r. Therefore replacing it with readdir Change-Id: Ib7ad8b662023f3b4736886a33c012f6147e4a288 Signed-off-by: Saqib Khan <khansa@us.ibm.com>
-rw-r--r--directory.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/directory.cpp b/directory.cpp
index f00ec89..2ba2536 100644
--- a/directory.cpp
+++ b/directory.cpp
@@ -44,17 +44,8 @@ bool Directory::next(std::string& name)
return false;
}
- dirent entry;
- dirent* result;
-
- auto rc = readdir_r(dirp, &entry, &result);
-
- if ((rc) || (NULL == result))
- {
- return false;
- }
-
- name = entry.d_name;
+ dirent* entry = readdir(dirp);
+ name = entry->d_name;
if (name == "." || name == "..")
{
OpenPOWER on IntegriCloud