diff options
Diffstat (limited to 'bpkg/fetch.cxx')
-rw-r--r-- | bpkg/fetch.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bpkg/fetch.cxx b/bpkg/fetch.cxx index 3ddd2e9..ebff730 100644 --- a/bpkg/fetch.cxx +++ b/bpkg/fetch.cxx @@ -495,6 +495,8 @@ namespace bpkg fail << "file " << r << " already exists"; string url (to_url (host, port, f)); + + auto_rm arm (r); process pr (start (o, url, r)); if (!pr.wait ()) @@ -506,6 +508,7 @@ namespace bpkg info << "re-run with -v for more information"; } + arm.cancel (); return r; } @@ -576,6 +579,8 @@ namespace bpkg if (!ifs.is_open ()) fail << "unable to open " << f << " in read mode"; + auto_rm arm (r); + ofstream ofs (r.string (), ios::binary); if (!ofs.is_open ()) fail << "unable to open " << r << " in write mode"; @@ -589,6 +594,8 @@ namespace bpkg // ifs.close (); ofs.close (); + + arm.cancel (); } catch (const iostream::failure&) { |