diff options
author | Chad Elliott <elliottc@objectcomputing.com> | 2022-12-14 15:12:31 -0600 |
---|---|---|
committer | Chad Elliott <elliottc@objectcomputing.com> | 2022-12-14 15:12:31 -0600 |
commit | 8e6ccc97292c56438e09268ed344d53b5b409591 (patch) | |
tree | 486b5258beb8be4a036328cdbf978f82c174a93c | |
parent | 55cb9352b26017329cabfd9eb030d6481652802d (diff) | |
download | ATCD-8e6ccc97292c56438e09268ed344d53b5b409591.tar.gz |
Use readdir() instead of readdir_r() since it is now deprecated.
-rw-r--r-- | ACE/ace/Dirent.inl | 15 |
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 |