Skip to content

Commit

Permalink
Fix shm issue
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull committed Jul 11, 2023
1 parent 3b6ff3e commit 6a46fbd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions x11rb-async/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ all-features = true

[dev-dependencies]
async-executor = "1.5.0"
libc = "0.2.147"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

[[example]]
Expand Down
2 changes: 1 addition & 1 deletion x11rb-async/examples/shared_memory_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::os::unix::io::AsRawFd;
use std::ptr::null_mut;

use async_executor::LocalExecutor;
use nix::libc::{mmap, MAP_FAILED, MAP_SHARED, PROT_READ, PROT_WRITE};
use libc::{mmap, MAP_FAILED, MAP_SHARED, PROT_READ, PROT_WRITE};

use x11rb_async::connection::Connection;
use x11rb_async::errors::{ConnectionError, ReplyError, ReplyOrIdError};
Expand Down
12 changes: 3 additions & 9 deletions x11rb-protocol/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,9 @@ mod raw_fd_container {
}
}

impl From<OwnedFd> for RawFdContainer {
fn from(fd: OwnedFd) -> Self {
Self::new(fd)
}
}

impl From<RawFdContainer> for OwnedFd {
fn from(fd: RawFdContainer) -> Self {
fd.0
impl<T: Into<OwnedFd>> From<T> for RawFdContainer {
fn from(fd: T) -> Self {
Self::new(fd.into())
}
}

Expand Down

0 comments on commit 6a46fbd

Please sign in to comment.