Skip to content

Commit

Permalink
Upgrade dependencies, and fix warn.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmjoy committed Aug 14, 2022
1 parent 6c1789f commit a0ff1eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ windows-shared-memory-equality = []

[dependencies]
bincode = "1"
crossbeam-channel = "0.4"
crossbeam-channel = "0.5"
fnv = "1.0.3"
futures = { version = "0.3", optional = true }
futures-test = { version = "0.3", optional = true }
Expand All @@ -26,14 +26,14 @@ libc = "0.2.12"
rand = "0.7"
serde = { version = "1.0", features = ["rc"] }
tempfile = "3"
uuid = { version = "0.8", features = ["v4"] }
uuid = { version = "1", features = ["v4"] }

[target.'cfg(any(target_os = "linux", target_os = "openbsd", target_os = "freebsd"))'.dependencies]
mio = "0.6.11"
sc = { version = "0.2.2", optional = true }

[dev-dependencies]
crossbeam-utils = "0.7"
crossbeam-utils = "0.8"

[target.'cfg(target_os = "windows")'.dependencies]
winapi = {version = "0.3.7", features = ["minwindef", "ioapiset", "memoryapi", "namedpipeapi", "handleapi", "fileapi", "impl-default", "synchapi"]}
15 changes: 7 additions & 8 deletions src/platform/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl OsIpcSender {
} else {
Err(UnixError::last())
}
};
}

fn send_followup_fragment(sender_fd: c_int, data_buffer: &[u8]) -> Result<(),UnixError> {
let result = unsafe {
Expand Down Expand Up @@ -703,9 +703,9 @@ impl BackingStore {

pub unsafe fn map_file(&self, length: Option<size_t>) -> (*mut u8, size_t) {
let length = length.unwrap_or_else(|| {
let mut st = mem::uninitialized();
assert!(libc::fstat(self.fd, &mut st) == 0);
st.st_size as size_t
let mut st = mem::MaybeUninit::uninit();
assert!(libc::fstat(self.fd, st.as_mut_ptr()) == 0);
st.assume_init().st_size as size_t
});
if length == 0 {
// This will cause `mmap` to fail, so handle it explicitly.
Expand Down Expand Up @@ -1115,11 +1115,11 @@ impl UnixCmsg {

fn is_socket(fd: c_int) -> bool {
unsafe {
let mut st = mem::uninitialized();
if libc::fstat(fd, &mut st) != 0 {
let mut st = mem::MaybeUninit::uninit();
if libc::fstat(fd, st.as_mut_ptr()) != 0 {
return false
}
S_ISSOCK(st.st_mode as mode_t)
S_ISSOCK(st.assume_init().st_mode as mode_t)
}
}

Expand Down Expand Up @@ -1168,4 +1168,3 @@ struct linger {
l_onoff: c_int,
l_linger: c_int,
}

0 comments on commit a0ff1eb

Please sign in to comment.