summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2010-08-10 14:53:12 +0200
committerJulian Andres Klode <jak@debian.org>2010-08-10 14:53:12 +0200
commit4a9db82795a64fce22128f8dc06596421ce2d865 (patch)
tree73362c5948e89b6c7b1c014af8e2179674c38e98 /apt-pkg
parentc6391a3bb2352abd011435e5122479344b0edf0e (diff)
apt-pkg/contrib/fileutl.cc: Add WriteAtomic mode.
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/fileutl.cc2
-rw-r--r--apt-pkg/contrib/fileutl.h3
2 files changed, 4 insertions, 1 deletions
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index 2a3b8a87d..f86bf2942 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -669,6 +669,7 @@ bool FileFd::Open(string FileName,OpenMode Mode, unsigned long Perms)
}
break;
+ case WriteAtomic:
case WriteEmpty:
{
Flags |= Replace;
@@ -678,6 +679,7 @@ bool FileFd::Open(string FileName,OpenMode Mode, unsigned long Perms)
free(name);
break;
}
+
case WriteExists:
iFd = open(FileName.c_str(),O_RDWR);
diff --git a/apt-pkg/contrib/fileutl.h b/apt-pkg/contrib/fileutl.h
index 62705478d..cb4655798 100644
--- a/apt-pkg/contrib/fileutl.h
+++ b/apt-pkg/contrib/fileutl.h
@@ -46,7 +46,8 @@ class FileFd
gzFile gz;
public:
- enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp,ReadOnlyGzip};
+ enum OpenMode {ReadOnly,WriteEmpty,WriteExists,WriteAny,WriteTemp,ReadOnlyGzip,
+ WriteAtomic};
inline bool Read(void *To,unsigned long Size,bool AllowEof)
{