summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/fileutl.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 6bfa5ca92..94d1432cf 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -1535,7 +1535,7 @@ public:
return false;
unsigned int flags = (Mode & (FileFd::WriteOnly|FileFd::ReadOnly));
- if (backend.OpenDescriptor(iFd, flags) == false)
+ if (backend.OpenDescriptor(iFd, flags, FileFd::None, true) == false)
return false;
// Write the file header
@@ -1646,6 +1646,11 @@ public:
res = LZ4F_freeDecompressionContext(dctx);
dctx = nullptr;
}
+ if (backend.IsOpen())
+ {
+ backend.Close();
+ filefd->iFd = -1;
+ }
return LZ4F_isError(res) == false;
}