summaryrefslogtreecommitdiff
path: root/lib/Handle.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-15 14:52:43 +0000
committerPixel <Pixel>2001-11-15 14:52:43 +0000
commit3f720784d55707024fff675a5238fde0168d1a40 (patch)
tree84a5b9843ede69aaf76cd9b791686b2a3ea7c3d7 /lib/Handle.cc
parent8694409f2a5531e9f3263e8a42248a3ca91ac14f (diff)
More work into TaskMan...
Diffstat (limited to 'lib/Handle.cc')
-rw-r--r--lib/Handle.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/Handle.cc b/lib/Handle.cc
index dd22b5c..6f7c6e5 100644
--- a/lib/Handle.cc
+++ b/lib/Handle.cc
@@ -9,9 +9,7 @@
Handle::Handle(const Handle & nh) : h(nh.h >= 0 ? dup(nh.h) : nh.h), closed(false), nonblock(false) { }
Handle::~Handle() {
- if (h >= 0) {
- ::close(h);
- }
+ close();
}
Handle::Handle(int nh) : h(nh), closed(false) { }
@@ -60,7 +58,7 @@ ssize_t Handle::write(const void *buf, size_t count) throw (GeneralException) {
ssize_t Handle::read(void *buf, size_t count) throw (GeneralException) {
ssize_t r;
-
+
errno = 0;
if ((r = ::read(h, buf, count)) < 0) {
if ((!errno) || (errno = EAGAIN)) {
@@ -73,8 +71,7 @@ ssize_t Handle::read(void *buf, size_t count) throw (GeneralException) {
}
if (!r) {
- ::close(h);
- closed = true;
+ close();
}
return r;