Skip to content

Commit b15a1dd

Browse files
jsturtevantmxpv
authored andcommitted
Transfer ownership of FD
Signed-off-by: James Sturtevant <[email protected]>
1 parent d32d023 commit b15a1dd

File tree

1 file changed

+2
-3
lines changed
  • crates/shim/src/asynchronous

1 file changed

+2
-3
lines changed

crates/shim/src/asynchronous/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use std::{
1818
convert::TryFrom,
1919
env,
20-
os::unix::{fs::FileTypeExt, io::AsRawFd, net::UnixListener},
20+
os::unix::{fs::FileTypeExt, net::UnixListener},
2121
path::Path,
2222
process,
2323
process::{Command, Stdio},
@@ -285,7 +285,7 @@ pub async fn spawn(opts: StartOpts, grouping: &str, vars: Vec<(&str, &str)>) ->
285285
&opts.address,
286286
])
287287
.fd_mappings(vec![FdMapping {
288-
parent_fd: listener.as_raw_fd(),
288+
parent_fd: listener.into(),
289289
child_fd: SOCKET_FD,
290290
}])?;
291291
if opts.debug {
@@ -296,7 +296,6 @@ pub async fn spawn(opts: StartOpts, grouping: &str, vars: Vec<(&str, &str)>) ->
296296
let _child = command.spawn().map_err(io_error!(e, "spawn shim"))?;
297297
#[cfg(target_os = "linux")]
298298
crate::cgroup::set_cgroup_and_oom_score(_child.id())?;
299-
std::mem::forget(listener);
300299
Ok(address)
301300
}
302301

0 commit comments

Comments
 (0)