summaryrefslogtreecommitdiffstats
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:48:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:48:10 +0000
commit7f9ceaec776a597e9ff8451038d57dd75e1e6d18 (patch)
tree284aa831d7c1c097a28b9048e594e071efa8e65c /apt-pkg/pkgcachegen.cc
parentReleasing progress-linux version 2.9.3-0.0~progress7.99u1. (diff)
downloadapt-7f9ceaec776a597e9ff8451038d57dd75e1e6d18.tar.xz
apt-7f9ceaec776a597e9ff8451038d57dd75e1e6d18.zip
Merging upstream version 2.9.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--apt-pkg/pkgcachegen.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index 5047561..981d360 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -1637,6 +1637,10 @@ static DynamicMMap* CreateDynamicMMap(FileFd * const CacheF, unsigned long Flags
static bool writeBackMMapToFile(pkgCacheGenerator * const Gen, DynamicMMap * const Map,
std::string const &FileName)
{
+ // Do not write the file back to /dev/null or try to change its mode...
+ if (FileName == "/dev/null")
+ return true;
+
FileFd SCacheF(FileName, FileFd::WriteAtomic);
if (SCacheF.IsOpen() == false || SCacheF.Failed())
return false;