BUG#: 5830
authorkumpf <kumpf>
Wed, 8 Nov 2006 20:44:51 +0000 (20:44 +0000)
committerkumpf <kumpf>
Wed, 8 Nov 2006 20:44:51 +0000 (20:44 +0000)
TITLE: Repository instance operation rollback may not remove rollback file
DESCRIPTION: Fixed the rollback logic for new instance files.

src/Pegasus/Repository/InstanceDataFile.cpp

index acd59ded9a6c1cd3327897e8011711a0b5258bec..f019f6e3ed39eee3fe242eef3f0cd42fe62edc2f 100644 (file)
@@ -365,13 +365,9 @@ Boolean InstanceDataFile::rollbackTransaction(const String& path)
     rollbackFs.close();
 
     //
-    // Now truncate the data file to that size:
+    // If the instance data file does not yet exist, create it
     //
-
-    //
-    // If the fileSize is zero, then create the InstanceDataFile and exit.
-    //
-    if ( fileSize == 0 )
+    if (fileSize == 0)
     {
         fstream ofs;
 
@@ -382,10 +378,12 @@ Boolean InstanceDataFile::rollbackTransaction(const String& path)
         }
 
         ofs.close();
-        PEG_METHOD_EXIT();
-        return true;
     }
 
+    //
+    // Truncate the data file to its initial size
+    //
+
     if (!System::truncateFile(path.getCString(), fileSize))
     {
         PEG_METHOD_EXIT();