diff options
author | Matthew Newhook <matthew@zeroc.com> | 2009-08-07 11:10:57 +0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2009-08-07 11:10:57 +0800 |
commit | e47e08887c823824bfc36f102c065075737394b1 (patch) | |
tree | dcbb175cb6ba3204ac55a06d61d28c488227ab4f /cpp/src/IceSSL/Util.cpp | |
parent | Revert "4171 - Global namespace pollution" (diff) | |
download | ice-e47e08887c823824bfc36f102c065075737394b1.tar.bz2 ice-e47e08887c823824bfc36f102c065075737394b1.tar.xz ice-e47e08887c823824bfc36f102c065075737394b1.zip |
Revert "Changes for bug 3962 and 4714"
This reverts commit d38ad95e45c0083d602a43e6d77e6c1599f324fe.
Diffstat (limited to 'cpp/src/IceSSL/Util.cpp')
-rw-r--r-- | cpp/src/IceSSL/Util.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cpp/src/IceSSL/Util.cpp b/cpp/src/IceSSL/Util.cpp index 796ca725130..9881cd3cb66 100644 --- a/cpp/src/IceSSL/Util.cpp +++ b/cpp/src/IceSSL/Util.cpp @@ -8,13 +8,19 @@ // ********************************************************************** #include <IceSSL/Util.h> -#include <IceUtil/FileUtil.h> #include <Ice/LocalException.h> #include <Ice/Network.h> #ifdef _WIN32 # include <direct.h> # include <sys/types.h> +# include <sys/stat.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 #include <openssl/err.h> @@ -280,8 +286,13 @@ IceSSL::checkPath(string& path, const string& defaultDir, bool dir) // argument is modified and true is returned. Otherwise // false is returned. // - IceUtilInternal::structstat st; - int err = IceUtilInternal::stat(path, &st); +#ifdef _WIN32 + struct _stat st; + int err = ::_stat(path.c_str(), &st); +#else + struct stat st; + int err = ::stat(path.c_str(), &st); +#endif if(err == 0) { return dir ? S_ISDIR(st.st_mode) != 0 : S_ISREG(st.st_mode) != 0; @@ -291,10 +302,11 @@ IceSSL::checkPath(string& path, const string& defaultDir, bool dir) { #ifdef _WIN32 string s = defaultDir + "\\" + path; + err = ::_stat(s.c_str(), &st); #else string s = defaultDir + "/" + path; + err = ::stat(s.c_str(), &st); #endif - err = ::IceUtilInternal::stat(s.c_str(), &st); if(err == 0 && ((!dir && S_ISREG(st.st_mode)) || (dir && S_ISDIR(st.st_mode)))) { path = s; |