diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:14:13 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-09-14 07:14:13 +0930 |
commit | 2cf3f7c07499f565101e1bcb835c73fc297ea72e (patch) | |
tree | dd1f4507984e47302b29cd6312ef12cf0c9afe1f /lib/tdb2/open.c | |
parent | 376511ed4defeeeabcfaa83acd230afd4a46b6fd (diff) | |
download | samba-2cf3f7c07499f565101e1bcb835c73fc297ea72e.tar.gz samba-2cf3f7c07499f565101e1bcb835c73fc297ea72e.tar.bz2 samba-2cf3f7c07499f565101e1bcb835c73fc297ea72e.zip |
tdb2: save open_flags instead of mmap_flags.
It's more consistent with what tdb1 does, and slightly more encapsulated.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(Imported from CCAN commit 6b7c3c840eafbec211b9f58751c5ff754302a68e)
Diffstat (limited to 'lib/tdb2/open.c')
-rw-r--r-- | lib/tdb2/open.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/tdb2/open.c b/lib/tdb2/open.c index bf901c7b35..2dd474cc81 100644 --- a/lib/tdb2/open.c +++ b/lib/tdb2/open.c @@ -369,6 +369,7 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, tdb->log_fn = NULL; tdb->transaction = NULL; tdb->access = NULL; + tdb->open_flags = open_flags; tdb->last_error = TDB_SUCCESS; tdb->file = NULL; tdb->lock_fn = tdb_fcntl_lock; @@ -416,11 +417,9 @@ struct tdb_context *tdb_open(const char *name, int tdb_flags, if ((open_flags & O_ACCMODE) == O_RDONLY) { tdb->read_only = true; - tdb->mmap_flags = PROT_READ; openlock = F_RDLCK; } else { tdb->read_only = false; - tdb->mmap_flags = PROT_READ | PROT_WRITE; openlock = F_WRLCK; } |