summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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