Skip to content

Commit c92e522

Browse files
authored
Merge pull request #84 from containers/update-rustix10
Port to rustix 1.0
2 parents e8c8c90 + 782ecc3 commit c92e522

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ futures-util = "0.3.13"
1414
# NOTE when bumping this in a semver-incompatible way, because we re-export it you
1515
# must also bump the semver of this project.
1616
oci-spec = "0.7.0"
17-
rustix = { version = "0.38", features = ["process", "net"] }
17+
rustix = { version = "1.0", features = ["process", "fs", "net"] }
1818
serde = { features = ["derive"], version = "1.0.125" }
1919
serde_json = "1.0.64"
2020
semver = "1.0.4"

src/imageproxy.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl TryFrom<ImageProxyConfig> for Command {
232232
unsafe {
233233
c.pre_exec(|| {
234234
rustix::process::set_parent_process_death_signal(Some(
235-
rustix::process::Signal::Term,
235+
rustix::process::Signal::TERM,
236236
))
237237
.map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e))
238238
});
@@ -383,8 +383,9 @@ impl ImageProxy {
383383
rustix::net::send(sockfd, &sendbuf, rustix::net::SendFlags::empty())?;
384384
drop(sendbuf);
385385
let mut buf = [0u8; MAX_MSG_SIZE];
386-
let mut cmsg_space = vec![0; rustix::cmsg_space!(ScmRights(1))];
387-
let mut cmsg_buffer = rustix::net::RecvAncillaryBuffer::new(&mut cmsg_space);
386+
let mut cmsg_space: Vec<std::mem::MaybeUninit<u8>> =
387+
vec![std::mem::MaybeUninit::uninit(); rustix::cmsg_space!(ScmRights(1))];
388+
let mut cmsg_buffer = rustix::net::RecvAncillaryBuffer::new(cmsg_space.as_mut_slice());
388389
let iov = std::io::IoSliceMut::new(buf.as_mut());
389390
let mut iov = [iov];
390391
let nread = rustix::net::recvmsg(

0 commit comments

Comments
 (0)