more TDB
This commit is contained in:
parent
8284bf65d5
commit
2586ac0b03
|
@ -127,8 +127,6 @@ int tdbPFileWrite(SPFile *pFile, SPage *pPage) {
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pFile->inTran;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pPage->isDirty == 0) {
|
if (pPage->isDirty == 0) {
|
||||||
|
@ -136,6 +134,8 @@ int tdbPFileWrite(SPFile *pFile, SPage *pPage) {
|
||||||
// TODO: add the page to the dirty list
|
// TODO: add the page to the dirty list
|
||||||
|
|
||||||
// TODO: write the page to the journal
|
// TODO: write the page to the journal
|
||||||
|
if (1 /*actually load from the file*/) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,17 @@ int tdbPFileBegin(SPFile *pFile) {
|
||||||
if (pFile->inTran) {
|
if (pFile->inTran) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* TODO */
|
|
||||||
|
// Open the journal
|
||||||
|
pFile->jfd = open(pFile->jFileName, O_RDWR | O_CREAT, 0755);
|
||||||
|
if (pFile->jfd < 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: write the size of the file
|
||||||
|
|
||||||
|
pFile->inTran = 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue