version 1.6, 2007/06/14 11:37:29
|
version 1.7, 2007/06/15 17:20:05
|
|
|
#include "InternalException.h" | #include "InternalException.h" |
| |
#include <iostream> | #include <iostream> |
|
#include <errno.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
| |
if (_dirRep.dir) | if (_dirRep.dir) |
{ | { |
// ATTN: DOI NOT REMOVE THE ERRNO=0 assignment |
#if defined(PEGASUS_OS_ZOS) || defined(PEGASUS_OS_VMS) |
|
// ATTN: DO NOT REMOVE THE errno = 0 assignment. |
// Reason: On some platforms readdir_r is a wrapper around | // Reason: On some platforms readdir_r is a wrapper around |
// readdir. Without errno set to 0, readdir reports a bad return | // readdir. Without errno set to 0, readdir reports a bad return |
// code even in the case that just the end of directory was reached. | // code even in the case that just the end of directory was reached. |
errno=0; | errno=0; |
|
#endif |
// Need to use readdir_r since we are multithreaded | // Need to use readdir_r since we are multithreaded |
if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0) | if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0) |
{ | { |
|
|
{ | { |
if (_more) | if (_more) |
{ | { |
// ATTN: DOI NOT REMOVE THE ERRNO=0 assignment |
#if defined(PEGASUS_OS_ZOS) || defined(PEGASUS_OS_VMS) |
|
// ATTN: DO NOT REMOVE THE errno = 0 assignment. |
// Reason: On some platforms readdir_r is a wrapper around | // Reason: On some platforms readdir_r is a wrapper around |
// readdir. Without errno set to 0, readdir reports a bad return | // readdir. Without errno set to 0, readdir reports a bad return |
// code even in the case that just the end of directory was reached. | // code even in the case that just the end of directory was reached. |
errno=0; | errno=0; |
|
#endif |
// Need to use readdir_r since we are multithreaded | // Need to use readdir_r since we are multithreaded |
if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0) | if (readdir_r(_dirRep.dir, &_dirRep.buffer, &_dirRep.entry) != 0) |
{ | { |