Changeset 865 for trunk/server
- Timestamp:
- May 15, 2014, 10:28:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/lib/tdb/common/open.c
r864 r865 684 684 // name could be null, so handle it 685 685 if (name == NULL) 686 return -1;686 return 0; 687 687 688 688 char activeLockName[_MAX_PATH]; 689 689 sprintf(activeLockName, "%s_AL", name); 690 tdb->hActiveLock = open(activeLockName, tdb->open_flags | O_CREAT, mode);690 tdb->hActiveLock = open(activeLockName, tdb->open_flags | O_CREAT, 0777); 691 691 if (tdb->hActiveLock == -1) { 692 692 TDB_LOG((tdb, TDB_DEBUG_ERROR, "os2_crtActiveLock: cannot create activeLock %s called from %s %s\n", … … 696 696 } 697 697 698 // we try to truncate the db when called from tdb_open_ex 699 // but if it's not working it's ok as well 698 700 if (truncate) { 699 701 if (lseek(tdb->hActiveLock, 0, SEEK_SET) == -1) 700 return -1;702 return 0; 701 703 702 704 if (ftruncate(tdb->hActiveLock, 0) == -1) 703 return -1;705 return 0; 704 706 705 707 tdb_write_all(tdb->hActiveLock, "used for active lock\n", 21);
Note:
See TracChangeset
for help on using the changeset viewer.