Boost logo

Boost :

From: Markus Schöpflin (markus.schoepflin_at_[hidden])
Date: 2006-02-17 08:32:25


Attached patch fixes a long standing problem with boost.filesystem on Tru64
which has resulted in test failures since quite some time.

It seems that readdir_r() on this platform behaves incorrect when errno is
not set to 0 previous to calling readdir_r().

This problem now has become critical, as it shows up during regression
testing with bb.v2, essentially prohibiting the report creation step of the
regression test run.

Therefore I would like to ask if this patch can be committed.

Thanks, Markus

Index: operations.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/filesystem/src/operations.cpp,v
retrieving revision 1.17
diff -u -r1.17 operations.cpp
--- operations.cpp 12 Feb 2006 23:18:45 -0000 1.17
+++ operations.cpp 17 Feb 2006 13:05:29 -0000
@@ -1187,6 +1187,8 @@
       inline int readdir_r_simulator( DIR * dirp, struct dirent * entry,
         struct dirent ** result ) // *result set to 0 on end of directory
         {
+ errno = 0;
+
     # if !defined(__CYGWIN__) \
           && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
           && defined(_SC_THREAD_SAFE_FUNCTIONS) \
@@ -1197,7 +1199,6 @@
     # endif
 
           struct dirent * p;
- errno = 0;
           *result = 0;
           if ( (p = ::readdir( dirp )) == 0 )
             return errno;


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk