Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/lib/tdb/tools/tdbbackup.c

    r414 r745  
    153153        }
    154154
    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");
    157158                tdb_close(tdb);
    158159                tdb_close(tdb_new);
     
    178179        tdb_close(tdb);
    179180
    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");
    186191        }
    187192
Note: See TracChangeset for help on using the changeset viewer.