Ignore:
Timestamp:
Nov 12, 2013, 7:56:26 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.6: small code cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/lib/tdb/common/lock.c

    r825 r826  
    123123        APIRET      rc;
    124124        ULONG       fAccess = 0; // default exclusiv
    125         FILELOCK    lockArea = {0}, unlockArea = {0}, unlockArea1 = {0};
     125        FILELOCK    lockArea = {0}, unlockArea = {0};
    126126
    127127        TDB_LOG((tdb, TDB_DEBUG_TRACE, "fcntl_lock in pid %d, fd %d, lck_type %s, rw_type %s, offset %d, len %d\n",
     
    140140                case F_UNLCK:
    141141                        unlockArea.lOffset = off;
    142                         unlockArea.lRange  = len ? len : tdb->header.hash_size *4; //was LONG_MAX
    143                         unlockArea1.lOffset = off;
    144                         unlockArea1.lRange  = len ? len : LONG_MAX;
     142                        unlockArea.lRange  = len ? len : LONG_MAX
    145143                        break;
    146144                case F_RDLCK:
     
    157155        }
    158156               
    159 // why DosSetFileLocks() in the F_UNLCK case with len == 0, fails is really a question
    160 // to overcome that i do 2 unlock with 2 different length (nasty workaround imho)
    161157        rc = DosSetFileLocks(tdb->fd, &unlockArea, &lockArea, SEM_IMMEDIATE_RETURN, fAccess);
    162         if (rc != NO_ERROR && rw == F_UNLCK && len == 0)
    163         rc = DosSetFileLocks(tdb->fd, &unlockArea1, &lockArea, SEM_IMMEDIATE_RETURN, fAccess);
    164158
    165159        if (rc != NO_ERROR && waitflag) {
     
    167161                do {
    168162                        rc = DosSetFileLocks(tdb->fd, &unlockArea, &lockArea, 100, fAccess);
    169                         if (rc != NO_ERROR && rw == F_UNLCK && len == 0)
    170                         rc = DosSetFileLocks(tdb->fd, &unlockArea1, &lockArea, 100, fAccess);
    171163                        count--;
    172164                } while( count>0 && rc !=NO_ERROR);
Note: See TracChangeset for help on using the changeset viewer.