Skip to content

Commit a546466

Browse files
author
Jeff Kim
committed
Fixing build errors due to crates updates.
1 parent 3019066 commit a546466

File tree

8 files changed

+75
-71
lines changed

8 files changed

+75
-71
lines changed

Cargo.lock

Lines changed: 52 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example-hello/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sync = ["rsbinder/sync", "rsbinder-aidl/sync"]
1111
async = ["rsbinder/async", "rsbinder-aidl/async"]
1212

1313
[dependencies]
14-
lazy_static = "1"
14+
lazy_static = "1.4"
1515
rsbinder = { version = "0.2.0", path = "../rsbinder", default-features = false }
1616
env_logger = "0.11"
1717
async-trait = "0.1"

rsbinder-aidl/Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ sync = []
1616
async = []
1717

1818
[dependencies]
19-
pest = "2"
20-
pest_derive = "2"
21-
convert_case = "0"
22-
lazy_static = "1"
23-
serde = { version = "1", features = ["derive"] }
24-
tera = "1"
19+
pest = "2.7"
20+
pest_derive = "2.7"
21+
convert_case = "0.6"
22+
lazy_static = "1.4"
23+
serde = { version = "1.0", features = ["derive"] }
24+
tera = "1.19"
2525

2626
[dev-dependencies]
27-
similar = "2"
27+
similar = "2.4"

rsbinder-tests/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ publish = false
77
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88

99
[dependencies]
10-
lazy_static = "1"
10+
lazy_static = "1.4"
1111
rsbinder = { version = "0.2.0", path = "../rsbinder" }
12-
tokio = { version = "1", features = ["full"] }
12+
tokio = { version = "1.36", features = ["full"] }
1313
env_logger = "0.11"
14-
nix = "0"
14+
nix = "0.28"
1515
async-trait = "0.1"
1616

1717
[build-dependencies]

rsbinder-tests/src/test_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use android::aidl::versioned::tests::{
4040
use android::aidl::tests::vintf::{
4141
VintfExtendableParcelable::VintfExtendableParcelable, VintfParcelable::VintfParcelable,
4242
};
43-
use std::fs::File;
43+
use std::{fs::File, os::fd::IntoRawFd};
4444
use std::io::{Read, Write};
4545
use std::os::unix::io::FromRawFd;
4646
use std::sync::{Arc, Mutex};
@@ -326,7 +326,7 @@ fn build_pipe() -> (File, File) {
326326
// and pass them after checking if the function returned
327327
// without an error, so the descriptors should be valid
328328
// by that point
329-
unsafe { (File::from_raw_fd(fds.0), File::from_raw_fd(fds.1)) }
329+
unsafe { (File::from_raw_fd(fds.0.into_raw_fd()), File::from_raw_fd(fds.1.into_raw_fd())) }
330330
}
331331

332332
/// Helper function that constructs a `File` from a `ParcelFileDescriptor`.

rsbinder-tools/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ readme = "README.md"
1111
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1212

1313
[dependencies]
14-
lazy_static = "1"
14+
lazy_static = "1.4"
1515
rsbinder = { version = "0.2.0", path = "../rsbinder" }
1616
log = "0.4"
1717
env_logger = "0.11"
18-
nix = "0"
18+
nix = "0.28"
1919
anstyle = "1.0"

rsbinder/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ tokio = ["async", "tokio/full"]
1818
async = ["rsbinder-aidl/async", "async-trait"]
1919

2020
[dependencies]
21-
nix = { version = "0", features = ["ioctl", "mount", "fs", "feature", "mman", "process"] }
21+
nix = { version = "0.28", features = ["ioctl", "mount", "fs", "feature", "mman", "process"] }
2222
log = "0.4"
23-
pretty_hex = { version = "0", package = "pretty-hex" }
23+
pretty_hex = { version = "0.4", package = "pretty-hex" }
2424
downcast-rs = "1.2"
2525
async-trait = { version = "0.1", optional = true }
26-
lazy_static = "1"
26+
lazy_static = "1.4"
2727
tokio = { version = "1.35", optional = true, default-features = false }
2828

2929
[build-dependencies]

rsbinder/src/process_state.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2022 Jeff Kim <hiking90@gmail.com>
22
// SPDX-License-Identifier: Apache-2.0
33

4+
use std::os::raw::c_void;
5+
use std::ptr::NonNull;
46
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
57
use std::collections::HashMap;
68
use std::sync::{Arc, RwLock, OnceLock};
@@ -31,7 +33,7 @@ const DEFAULT_MAX_BINDER_THREADS: u32 = 15;
3133
const DEFAULT_ENABLE_ONEWAY_SPAM_DETECTION: u32 = 1;
3234

3335
struct MemoryMap {
34-
ptr: *mut std::ffi::c_void,
36+
ptr: NonNull<c_void>,
3537
size: usize,
3638
}
3739
unsafe impl Sync for MemoryMap {}
@@ -93,7 +95,7 @@ impl ProcessState {
9395
vm_size,
9496
nix::sys::mman::ProtFlags::PROT_READ,
9597
nix::sys::mman::MapFlags::MAP_PRIVATE | nix::sys::mman::MapFlags::MAP_NORESERVE,
96-
Some(&driver),
98+
&driver,
9799
0)?;
98100

99101
(vm_start, vm_size)
@@ -305,9 +307,7 @@ fn open_driver(driver: &Path, max_threads: u32) -> std::result::Result<File, Box
305307

306308
impl Drop for ProcessState {
307309
fn drop(self: &mut ProcessState) {
308-
let mut mmap = self.mmap.write().unwrap();
310+
let mmap = self.mmap.write().unwrap();
309311
unsafe { nix::sys::mman::munmap(mmap.ptr, mmap.size).unwrap(); }
310-
mmap.ptr = std::ptr::null_mut();
311-
mmap.size = 0;
312312
}
313313
}

0 commit comments

Comments
 (0)