diff options
Diffstat (limited to 'lib/CopyJob.cc')
-rw-r--r-- | lib/CopyJob.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CopyJob.cc b/lib/CopyJob.cc index fc2a0ca..9f7da95 100644 --- a/lib/CopyJob.cc +++ b/lib/CopyJob.cc @@ -5,15 +5,16 @@ #include "gettext.h" CopyJob::CopyJob(Handle * as, Handle * ad, ssize_t asiz, bool ads, bool add, int ashape) : s(as), d(ad), ds(ads), dd(add), siz(asiz), cursiz(0), r(0), w(0), tw(0), shape(ashape) { - struct timezone tz; - s->SetNonBlock(); d->SetNonBlock(); WaitFor(s, W4_READING); - +#ifndef _WIN32 + struct timezone tz; + if (shape > 0) { gettimeofday(&start, &tz); } +#endif } CopyJob::~CopyJob() { @@ -29,12 +30,15 @@ CopyJob::~CopyJob() { int CopyJob::Do() throw (GeneralException) { int tr; struct timeval now; - struct timezone tz; +#ifndef _WIN32 + struct timezone tz; + if (shape > 0) { gettimeofday(&now, &tz); } - +#endif + switch (current) { case 0: tr = siz >= 0 ? siz - cursiz : COPY_BUFSIZ; |