diff options
author | dwight <dwight@10gen.com> | 2010-12-14 20:27:24 -0500 |
---|---|---|
committer | dwight <dwight@10gen.com> | 2010-12-14 20:27:24 -0500 |
commit | ba84222056a7c926b6a92c7e17d50184b18b610f (patch) | |
tree | 0f8d6873cd14f2092eed280ecde72d1dce0f4f51 /db/dur_journalformat.h | |
parent | b608193a5852728a3664e14f941bef93866ffdfd (diff) | |
download | mongo-ba84222056a7c926b6a92c7e17d50184b18b610f.tar.gz |
use relative paths in the journal
Diffstat (limited to 'db/dur_journalformat.h')
-rw-r--r-- | db/dur_journalformat.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/db/dur_journalformat.h b/db/dur_journalformat.h index be671a55f9e..32338a10453 100644 --- a/db/dur_journalformat.h +++ b/db/dur_journalformat.h @@ -30,8 +30,10 @@ namespace mongo { JHeader() { } JHeader(string fname); - char magic[2]; // "j\n" - unsigned short version; // 0x4141 or "AA" + char magic[2]; // "j\n". j means journal, then a linefeed, fwiw if you were to run "less" on the file or something... + + enum { CurrentVersion = 0x4142 }; + unsigned short _version; // these are just for diagnostic ease (make header more useful as plain text) char n1; // '\n' @@ -43,7 +45,7 @@ namespace mongo { char reserved3[8192 - 68 - 96 + 10 -4]; // 8KB total for the file header char txt2[2]; // "\n\n" offset 8190 - bool versionOk() const { return version == 0x4141; } + bool versionOk() const { return _version == CurrentVersion; } bool valid() const { return magic[0] == 'j' && txt2[1] == '\n'; } }; |