Ignore:
Timestamp:
Nov 13, 2013, 2:36:44 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba 3.5: backported some code from 3.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/lib/tdb/common/open.c

    r781 r829  
    185185
    186186#ifdef __OS2__
    187         if (os2_crtsem(tdb, name, "tdb_open_ex") != 0) {
     187        if (os2_CrtSem(tdb, name, "tdb_open_ex") != 0) {
    188188                goto fail;
    189189        }
     
    407407        SAFE_FREE(tdb->name);
    408408#ifdef __OS2__
    409         DosCloseMutexSem( tdb->hGlobalLock);
    410         tdb->hGlobalLock = 0;
    411         DosCloseMutexSem( tdb->hActiveLock);
    412         tdb->hActiveLock = 0;
    413         DosCloseMutexSem( tdb->hTransactionLock);
    414         tdb->hTransactionLock = 0;
     409        os2_DltSem(tdb, "tdb_open_ex");
    415410#endif
    416411        if (tdb->fd != -1)
     
    465460        SAFE_FREE(tdb->lockrecs);
    466461#ifdef __OS2__
    467         DosCloseMutexSem( tdb->hGlobalLock);
    468         tdb->hGlobalLock = 0;
    469         DosCloseMutexSem( tdb->hActiveLock);
    470         tdb->hActiveLock = 0;
    471         DosCloseMutexSem( tdb->hTransactionLock);
    472         tdb->hTransactionLock = 0;
     462        os2_DltSem(tdb, "tdb_close");   
    473463#endif
    474464
     
    514504
    515505#ifdef __OS2__
    516         DosCloseMutexSem( tdb->hGlobalLock);
    517         tdb->hGlobalLock = 0;
    518         DosCloseMutexSem( tdb->hActiveLock);
    519         tdb->hActiveLock = 0;
    520         DosCloseMutexSem( tdb->hTransactionLock);
    521         tdb->hTransactionLock = 0;
    522 
    523         if (os2_crtsem(tdb, tdb->name, "tdb_reopen") != 0) {
     506        os2_DltSem(tdb, "tdb_reopen");
     507
     508        if (os2_CrtSem(tdb, tdb->name, "tdb_reopen") != 0) {
    524509                goto fail;
    525510        }
     
    613598
    614599#ifdef __OS2__
    615 int os2_crtsem(struct tdb_context *tdb, const char *name, const char *caller)
     600int os2_CrtSem(struct tdb_context *tdb, const char *name, const char *caller)
    616601{
    617602        // name could be null, so handle it
     
    661646        return 0;
    662647}
     648
     649int os2_DltSem(struct tdb_context *tdb, const char *caller)
     650{
     651        DosCloseMutexSem( tdb->hGlobalLock);
     652        tdb->hGlobalLock = 0;
     653        DosCloseMutexSem( tdb->hActiveLock);
     654        tdb->hActiveLock = 0;
     655        DosCloseMutexSem( tdb->hTransactionLock);
     656        tdb->hTransactionLock = 0;
     657
     658        return 0;
     659}
    663660#endif
    664661               
Note: See TracChangeset for help on using the changeset viewer.