From 3f720784d55707024fff675a5238fde0168d1a40 Mon Sep 17 00:00:00 2001 From: Pixel Date: Thu, 15 Nov 2001 14:52:43 +0000 Subject: More work into TaskMan... --- lib/Handle.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/Handle.cc') 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; -- cgit v1.2.3