diff options
author | Marc Laukien <marc@zeroc.com> | 2004-11-25 13:28:03 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-11-25 13:28:03 +0000 |
commit | 15e0d09c48668f4674cc86990c18f6e34277b62d (patch) | |
tree | efbbd470c1424d75595f6a79c9b84a1a2c3b1bd3 /cpp/src/IcePatch2/FileServerI.cpp | |
parent | Changed IceUtil::GCShared to derive from IceUtil::Shared. (diff) | |
download | ice-15e0d09c48668f4674cc86990c18f6e34277b62d.tar.bz2 ice-15e0d09c48668f4674cc86990c18f6e34277b62d.tar.xz ice-15e0d09c48668f4674cc86990c18f6e34277b62d.zip |
.dsp files for IcePatch2
Diffstat (limited to 'cpp/src/IcePatch2/FileServerI.cpp')
-rw-r--r-- | cpp/src/IcePatch2/FileServerI.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/cpp/src/IcePatch2/FileServerI.cpp b/cpp/src/IcePatch2/FileServerI.cpp index 313b14e3247..cc4a8c1f6ab 100644 --- a/cpp/src/IcePatch2/FileServerI.cpp +++ b/cpp/src/IcePatch2/FileServerI.cpp @@ -8,13 +8,13 @@ // ********************************************************************** #include <IcePatch2/FileServerI.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> #ifdef _WIN32 # include <io.h> #else -# include <sys/types.h> -# include <sys/stat.h> -# include <fcntl.h> # include <unistd.h> #endif @@ -74,7 +74,11 @@ IcePatch2::FileServerI::getFileCompressed(const string& pa, Int pos, Int num, co num = 256 * 1024; } +#ifdef _WIN32 + int fd = open(path.c_str(), _O_RDONLY | _O_BINARY); +#else int fd = open(path.c_str(), O_RDONLY); +#endif if(fd == -1) { FileAccessException ex; @@ -95,7 +99,11 @@ IcePatch2::FileServerI::getFileCompressed(const string& pa, Int pos, Int num, co } ByteSeq bytes(num); +#ifdef _WIN32 + long r; +#else ssize_t r; +#endif if((r = read(fd, &bytes[0], static_cast<size_t>(num))) == -1) { close(fd); |