From: Mikko Rasa Date: Sun, 3 Sep 2006 20:50:01 +0000 (+0000) Subject: Create destination path in Copy instead of source path X-Git-Tag: 0.9~62 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=5504b35e6c6cfb1cfa098b94e31cda173cc0482a;p=builder.git Create destination path in Copy instead of source path Initialize Copy::Worker::error to false --- diff --git a/source/copy.cpp b/source/copy.cpp index c9cb311..cdbbd48 100644 --- a/source/copy.cpp +++ b/source/copy.cpp @@ -32,7 +32,8 @@ int Copy::check() void Copy::Worker::main() { - Path::mkpath(copy.src.subpath(0, copy.src.size()-1), 0755); + Path::mkpath(copy.dest.subpath(0, copy.dest.size()-1), 0755); + if(unlink(copy.dest.str().c_str())<0 && errno!=ENOENT) { int err=errno; diff --git a/source/copy.h b/source/copy.h index 283ef48..ade21dd 100644 --- a/source/copy.h +++ b/source/copy.h @@ -16,7 +16,7 @@ private: class Worker: public Msp::Thread { public: - Worker(Copy &i): copy(i), done(false) { launch(); } + Worker(Copy &i): copy(i), done(false), error(false) { launch(); } bool get_done() const { return done; } bool get_error() const { return error; } private: