|
|
@ -1,6 +1,6 @@ |
|
|
|
use libc::{c_uint, size_t, mode_t}; |
|
|
|
use libc::{c_uint, size_t, mode_t}; |
|
|
|
use std::ffi::CString; |
|
|
|
use std::ffi::CString; |
|
|
|
use std::io::FilePermission; |
|
|
|
use std::old_io::FilePermission; |
|
|
|
use std::path::BytesContainer; |
|
|
|
use std::path::BytesContainer; |
|
|
|
use std::ptr; |
|
|
|
use std::ptr; |
|
|
|
use std::sync::Mutex; |
|
|
|
use std::sync::Mutex; |
|
|
@ -150,7 +150,7 @@ impl Drop for Environment { |
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
/// Options for opening or creating an environment.
|
|
|
|
/// Options for opening or creating an environment.
|
|
|
|
#[derive(Show, PartialEq, Eq, Copy, Clone)] |
|
|
|
#[derive(Debug, PartialEq, Eq, Copy, Clone)] |
|
|
|
pub struct EnvironmentBuilder { |
|
|
|
pub struct EnvironmentBuilder { |
|
|
|
flags: EnvironmentFlags, |
|
|
|
flags: EnvironmentFlags, |
|
|
|
max_readers: Option<c_uint>, |
|
|
|
max_readers: Option<c_uint>, |
|
|
@ -237,7 +237,7 @@ impl EnvironmentBuilder { |
|
|
|
#[cfg(test)] |
|
|
|
#[cfg(test)] |
|
|
|
mod test { |
|
|
|
mod test { |
|
|
|
|
|
|
|
|
|
|
|
use std::io; |
|
|
|
use std::old_io as io; |
|
|
|
|
|
|
|
|
|
|
|
use flags::*; |
|
|
|
use flags::*; |
|
|
|
use super::*; |
|
|
|
use super::*; |
|
|
@ -325,7 +325,7 @@ mod test { |
|
|
|
let env = Environment::new().set_flags(READ_ONLY) |
|
|
|
let env = Environment::new().set_flags(READ_ONLY) |
|
|
|
.open(dir.path(), io::USER_RWX) |
|
|
|
.open(dir.path(), io::USER_RWX) |
|
|
|
.unwrap(); |
|
|
|
.unwrap(); |
|
|
|
assert!(env.sync(true).is_ok()); |
|
|
|
env.sync(true).unwrap(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|