Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6f5baf

Browse files
committed
Merge branch 'master' into develop
2 parents7c73d5a +32fa1af commitf6f5baf

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

‎Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ nb = "1"
4141
log ="0.4"
4242
byte_conv ="0.1.1"
4343
hex ="0.4"
44-
itertools ="0.10"
44+
itertools ="0.13"
4545
libc ="0.2"
46-
nix ="0.26"
47-
bitflags ="1.3"
46+
nix ={version="0.29",features = ["poll","process","net"] }
47+
bitflags ="2.6"
4848
thiserror ="1.0"
4949
socket2 = {version ="0.5",features = ["all"] }
5050
clap = {version ="3.2",optional =true }
51-
anyhow = {version ="1.0",optional =true }
51+
anyhow = {version ="1",optional =true }
5252
neli = {version ="0.6",optional =true }
5353
tokio = {version ="1",features = ["net"],optional =true }
54-
mio = {version ="0.8",features = ["os-ext"],optional =true }
54+
mio = {version ="1",features = ["os-ext"],optional =true }
5555
futures = {version ="0.3",optional =true }
5656
async-io = {version ="1.13",optional =true }
5757
smol = {version ="1.3",optional =true }

‎src/nl/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ impl CanInterface {
453453
/// has specific, non-default, generic parameters.
454454
fnopen_route_socket<T,P>() ->Result<NlSocketHandle,NlError<T,P>>{
455455
// retrieve PID
456-
let pid = unistd::getpid().as_raw()asu32;
456+
let pid = unistd::Pid::this().as_raw()asu32;
457457

458458
// open and bind socket
459459
// groups is set to None(0), because we want no notifications

‎src/socket.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,16 @@ pub trait Socket: AsRawFd {
249249

250250
/// Blocking read a single can frame with timeout.
251251
fnread_frame_timeout(&self,timeout:Duration) ->IoResult<Self::FrameType>{
252-
use nix::poll::{poll,PollFd,PollFlags};
253-
let pollfd =PollFd::new(self.as_raw_fd(),PollFlags::POLLIN);
254-
255-
matchpoll(&mut[pollfd], timeout.as_millis()asc_int)?{
252+
use nix::poll::{poll,PollFd,PollFlags,PollTimeout};
253+
let pollfd =PollFd::new(
254+
unsafe{BorrowedFd::borrow_raw(self.as_raw_fd())},
255+
PollFlags::POLLIN,
256+
);
257+
258+
matchpoll(
259+
&mut[pollfd],
260+
timeout.try_into().unwrap_or(PollTimeout::MAX),
261+
)?{
256262
0 =>Err(IoErrorKind::TimedOut.into()),
257263
_ =>self.read_frame(),
258264
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp