summaryrefslogtreecommitdiff
path: root/generic/Handle.cpp
diff options
context:
space:
mode:
authorPixel <Pixel>2002-08-15 22:09:26 +0000
committerPixel <Pixel>2002-08-15 22:09:26 +0000
commitd962e8d2d650c7b297dcd041b55060bc29996a93 (patch)
tree696546c56615e3ab8022bb33979f8602957e7739 /generic/Handle.cpp
parent1d836e3fd9d3c4f9ce08b6a062dd597e5fe4e1dc (diff)
bleeeeh
Diffstat (limited to 'generic/Handle.cpp')
-rw-r--r--generic/Handle.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/generic/Handle.cpp b/generic/Handle.cpp
index 6390a6d..29b4816 100644
--- a/generic/Handle.cpp
+++ b/generic/Handle.cpp
@@ -149,6 +149,7 @@ void Handle::close() throw (GeneralException) {
}
if (h >= 0) {
+#ifdef HAVE_ZLIB
if (z) {
// cerr << "Performing gzclose on handle " << h << endl;
int err = gzclose(zfile);
@@ -161,6 +162,9 @@ void Handle::close() throw (GeneralException) {
}
}
} else {
+#else
+ {
+#endif
int err = ::close(h);
if (err) {
throw GeneralException(String(_("Error during close: ")) + strerror(errno));
@@ -204,6 +208,7 @@ void Handle::Dup(const Handle & H) {
}
}
+#ifdef HAVE_ZLIB
void Handle::SetZ(int az) throw (GeneralException) {
if (z) {
throw GeneralException(_("Can't SetZ a Handle twice."));
@@ -229,8 +234,10 @@ void Handle::SetZ(int az) throw (GeneralException) {
z = az;
}
}
+#endif
ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException) {
+#ifdef HAVE_ZLIB
if (z) {
itell += count;
// cerr << "Performing gzwrite of " << count << " byte for handle " << h << endl;
@@ -246,12 +253,16 @@ ssize_t Handle::uwrite(const void * buf, size_t count) throw (GeneralException)
}
return err;
} else {
+#else
+ {
+#endif
itell += count = ::write(h, buf, count);
return count;
}
}
ssize_t Handle::uread(void * buf, size_t count) {
+#ifdef HAVE_ZLIB
if (z) {
itell += count;
// cerr << "Performing gzread of " << count << " byte for handle " << h << endl;
@@ -267,6 +278,9 @@ ssize_t Handle::uread(void * buf, size_t count) {
}
return err;
} else {
+#else
+ {
+#endif
itell += count = ::read(h, buf, count);
return count;
}