Changeset 745 for trunk/server/lib/tdb/tools/tdbbackup.c
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/lib/tdb/tools/tdbbackup.c
r414 r745 153 153 } 154 154 155 if (tdb_transaction_start(tdb_new) != 0) { 156 printf("Failed to start transaction on new tdb\n"); 155 /* lock the backup tdb so that nobody else can change it */ 156 if (tdb_lockall(tdb_new) != 0) { 157 printf("Failed to lock backup tdb\n"); 157 158 tdb_close(tdb); 158 159 tdb_close(tdb_new); … … 178 179 tdb_close(tdb); 179 180 180 if (tdb_transaction_commit(tdb_new) != 0) { 181 fprintf(stderr, "Failed to commit new tdb\n"); 182 tdb_close(tdb_new); 183 unlink(tmp_name); 184 free(tmp_name); 185 return 1; 181 /* copy done, unlock the backup tdb */ 182 tdb_unlockall(tdb_new); 183 184 #ifdef HAVE_FDATASYNC 185 if (fdatasync(tdb_fd(tdb_new)) != 0) { 186 #else 187 if (fsync(tdb_fd(tdb_new)) != 0) { 188 #endif 189 /* not fatal */ 190 fprintf(stderr, "failed to fsync backup file\n"); 186 191 } 187 192
Note:
See TracChangeset
for help on using the changeset viewer.