]> git.saurik.com Git - apt.git/commitdiff
apt-pkg/contrib/fileutl.cc: Add WriteAtomic mode.
authorJulian Andres Klode <jak@debian.org>
Tue, 10 Aug 2010 12:53:12 +0000 (14:53 +0200)
committerJulian Andres Klode <jak@debian.org>
Tue, 10 Aug 2010 12:53:12 +0000 (14:53 +0200)
apt-pkg/contrib/fileutl.cc
apt-pkg/contrib/fileutl.h
debian/changelog

index 2a3b8a87daa0b062ea484f1b5d432a121e86658a..f86bf2942ea011f14059ea7547c5e40aad61f4aa 100644 (file)
@@ -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);
index 62705478def3b8789fe1e291092c90e8a0510cd1..cb465579803683bda742cb89cfc2d6a013da529a 100644 (file)
@@ -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)
    {
index 1927ef8989fd91c0040b94662b3493bbef7efc65..9f3d1df85f42e1db3ab165ff36dd13e163dfe3d2 100644 (file)
@@ -9,6 +9,8 @@ apt (0.7.26~exp13) UNRELEASEDexperimental; urgency=low
     - fix off-by-one error in DropBinaryArch
 
   [ Julian Andres Klode ]
+  * apt-pkg/contrib/fileutl.cc:
+    - Add WriteAtomic mode.
   * apt-pkg/depcache.cc:
     - Only try upgrade for Breaks if there is a newer version, otherwise
       handle it as Conflicts (by removing it) (helps for #591882).