소스 검색

Merge pull request #479 from richardkchapman/gh-478_readdir

gh-478 - CLinuxDirectoryIterator not threadsafe
Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 13 년 전
부모
커밋
d6da647dd9
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      system/jlib/jfile.cpp

+ 2 - 1
system/jlib/jfile.cpp

@@ -3326,10 +3326,11 @@ public:
     bool next()
     {
         loop {
+            struct dirent dirEntry;
             struct dirent *entry;
             loop {
                 gotst = false;
-                entry = readdir(handle);  // don't need _r here 
+                readdir_r(handle, &dirEntry, &entry);
                 // need better checking here?
                 if (!entry)
                     break;