summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Elliott <elliottc@objectcomputing.com>2022-12-14 15:12:31 -0600
committerChad Elliott <elliottc@objectcomputing.com>2022-12-14 15:12:31 -0600
commit8e6ccc97292c56438e09268ed344d53b5b409591 (patch)
tree486b5258beb8be4a036328cdbf978f82c174a93c
parent55cb9352b26017329cabfd9eb030d6481652802d (diff)
downloadATCD-8e6ccc97292c56438e09268ed344d53b5b409591.tar.gz
Use readdir() instead of readdir_r() since it is now deprecated.
-rw-r--r--ACE/ace/Dirent.inl15
1 files changed, 12 insertions, 3 deletions
diff --git a/ACE/ace/Dirent.inl b/ACE/ace/Dirent.inl
index 3e420f1cc71..04f6f716e7a 100644
--- a/ACE/ace/Dirent.inl
+++ b/ACE/ace/Dirent.inl
@@ -56,9 +56,18 @@ ACE_INLINE int
ACE_Dirent::read (struct ACE_DIRENT *entry,
struct ACE_DIRENT **result)
{
- return this->dirp_
- ? ACE_OS::readdir_r (this->dirp_, entry, result)
- : 0;
+ int status = EBADF;
+ if (this->dirp_ && entry && result)
+ {
+ ACE_DIRENT* ptr = ACE_OS::readdir (this->dirp_);
+ if (ptr)
+ {
+ *entry = *ptr;
+ }
+ *result = ptr;
+ status = 0;
+ }
+ return status;
}
ACE_INLINE void