summaryrefslogtreecommitdiffstats
path: root/apt-pkg/pkgcachegen.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:48:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:48:09 +0000
commit9cdf75717d2202fcae7e4cef319e3bb9ce175a71 (patch)
tree1ce23b2173cdefb82d14b99c0435bb82e1c80f80 /apt-pkg/pkgcachegen.cc
parentAdding debian version 2.9.3. (diff)
downloadapt-9cdf75717d2202fcae7e4cef319e3bb9ce175a71.tar.xz
apt-9cdf75717d2202fcae7e4cef319e3bb9ce175a71.zip
Merging upstream version 2.9.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'apt-pkg/pkgcachegen.cc')
-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;