diff options
Diffstat (limited to 'cpp/src/IceGrid/IceGridNode.cpp')
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 37 |
1 files changed, 13 insertions, 24 deletions
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 1e74f7800b7..15bc9b05a2f 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -10,6 +10,7 @@ #include <IceUtil/UUID.h> #include <IceUtil/Timer.h> #include <IceUtil/StringUtil.h> +#include <IceUtil/FileUtil.h> #include <Ice/Ice.h> #include <Ice/Locator.h> #include <Ice/Service.h> @@ -26,14 +27,7 @@ #ifdef _WIN32 # include <direct.h> # include <sys/types.h> -# include <sys/stat.h> # include <winsock2.h> -# ifdef _MSC_VER -# define S_ISDIR(mode) ((mode) & _S_IFDIR) -# define S_ISREG(mode) ((mode) & _S_IFREG) -# endif -#else -# include <sys/stat.h> #endif using namespace std; @@ -370,21 +364,7 @@ NodeService::startImpl(int argc, char* argv[], int& status) } else { -#ifdef _WIN32 - struct _stat filestat; - if(::_stat(dataPath.c_str(), &filestat) != 0 || !S_ISDIR(filestat.st_mode)) - { - ostringstream os; - FileException ex(__FILE__, __LINE__); - ex.path = dataPath; - ex.error = IceInternal::getSystemErrno(); - os << ex; - error("property `IceGrid.Node.Data' is set to an invalid path:\n" + os.str()); - return false; - } -#else - struct stat filestat; - if(::stat(dataPath.c_str(), &filestat) != 0 || !S_ISDIR(filestat.st_mode)) + if(!IceUtilInternal::directoryExists(dataPath)) { ostringstream os; FileException ex(__FILE__, __LINE__); @@ -393,8 +373,7 @@ NodeService::startImpl(int argc, char* argv[], int& status) os << ex; error("property `IceGrid.Node.Data' is set to an invalid path:\n" + os.str()); return false; - } -#endif + } // // Creates subdirectories. @@ -842,8 +821,18 @@ NodeService::usage(const string& appName) print("Usage: " + appName + " [options]\n" + options); } +//COMPILERFIX: Borland C++ 2010 doesn't support wmain for console applications. +#if defined(_WIN32 ) && !defined(__BCPLUSPLUS__) + +int +wmain(int argc, wchar_t* argv[]) + +#else + int main(int argc, char* argv[]) + +#endif { NodeService svc; return svc.main(argc, argv); |