Changeset 825
- Timestamp:
- Nov 12, 2013, 5:54:34 PM (12 years ago)
- Location:
- trunk/server/lib/tdb/common
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/lib/tdb/common/lock.c
r783 r825 123 123 APIRET rc; 124 124 ULONG fAccess = 0; // default exclusiv 125 int fLock = 1; // default lock126 off_t cbFile;127 off_t offStart;128 off_t cbRange;129 125 FILELOCK lockArea = {0}, unlockArea = {0}, unlockArea1 = {0}; 130 126 … … 143 139 { 144 140 case F_UNLCK: 145 fLock = 0;146 141 unlockArea.lOffset = off; 147 142 unlockArea.lRange = len ? len : tdb->header.hash_size *4; //was LONG_MAX -
trunk/server/lib/tdb/common/open.c
r782 r825 243 243 244 244 #ifdef __OS2__ 245 if (os2_ crtsem(tdb, name, "tdb_open_ex") != 0) {245 if (os2_CrtSem(tdb, "tdb_open_ex") != 0) { 246 246 goto fail; 247 247 } … … 512 512 TDB_LOG((tdb, TDB_DEBUG_ERROR, "tdb_open_ex: failed to close tdb->fd on error!\n")); 513 513 #ifdef __OS2__ 514 DosCloseMutexSem( tdb->hGlobalLock); 515 tdb->hGlobalLock = 0; 516 DosCloseMutexSem( tdb->hActiveLock); 517 tdb->hActiveLock = 0; 518 DosCloseMutexSem( tdb->hTransactionLock); 519 tdb->hTransactionLock = 0; 514 os2_DltSem(tdb, "tdb_open_ex"); 520 515 #endif 521 516 SAFE_FREE(tdb->lockrecs); … … 570 565 571 566 #ifdef __OS2__ 572 DosCloseMutexSem( tdb->hGlobalLock); 573 tdb->hGlobalLock = 0; 574 DosCloseMutexSem( tdb->hActiveLock); 575 tdb->hActiveLock = 0; 576 DosCloseMutexSem( tdb->hTransactionLock); 577 tdb->hTransactionLock = 0; 567 os2_DltSem(tdb, "tdb_close"); 578 568 #endif 579 569 /* Remove from contexts list */ … … 618 608 619 609 #ifdef __OS2__ 620 DosCloseMutexSem( tdb->hGlobalLock); 621 tdb->hGlobalLock = 0; 622 DosCloseMutexSem( tdb->hActiveLock); 623 tdb->hActiveLock = 0; 624 DosCloseMutexSem( tdb->hTransactionLock); 625 tdb->hTransactionLock = 0; 626 627 if (os2_crtsem(tdb, tdb->name, "tdb_reopen") != 0) { 610 os2_DltSem(tdb, "tdb_reopen"); 611 612 if (os2_CrtSem(tdb, "tdb_reopen") != 0) { 628 613 goto fail; 629 614 } … … 720 705 721 706 #ifdef __OS2__ 722 int os2_ crtsem(struct tdb_context *tdb, const char *name, const char *caller)723 { 724 // name could be null, so handle it725 if ( name == NULL) return -1;707 int os2_CrtSem(struct tdb_context *tdb, const char *caller) 708 { 709 // tbd->name could be null, so handle it 710 if (tdb->name == NULL) return -1; 726 711 727 712 if (!(tdb->flags & TDB_INTERNAL)) … … 732 717 APIRET rc; 733 718 // extract path info 734 _splitpath( name, drive, dir, fname, ext);719 _splitpath( tdb->name, drive, dir, fname, ext); 735 720 sprintf( szSem, "\\SEM32\\TDB_OL_%s%s%s%i", dir, fname, ext, global_Sem32Add); 736 721 rc = DosCreateMutexSem( szSem, &tdb->hGlobalLock, 0, FALSE); … … 768 753 return 0; 769 754 } 770 #endif 755 756 int os2_DltSem(struct tdb_context *tdb, const char *caller) 757 { 758 DosCloseMutexSem( tdb->hGlobalLock); 759 tdb->hGlobalLock = 0; 760 DosCloseMutexSem( tdb->hActiveLock); 761 tdb->hActiveLock = 0; 762 DosCloseMutexSem( tdb->hTransactionLock); 763 tdb->hTransactionLock = 0; 764 765 return 0; 766 } 767 #endif
Note:
See TracChangeset
for help on using the changeset viewer.