Skip to content

Commit ddc6152

Browse files
authored
Avoid allocating in pre_exec closure (#2213)
2 parents 2d797c5 + f2ea442 commit ddc6152

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/subprocess.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn spawn_process(cmd: &str, args: &[&str]) -> io::Result<()> {
1111
// Safety: libc::daemon() is async-signal-safe
1212
unsafe {
1313
proc.pre_exec(|| match libc::daemon(0, 0) {
14-
-1 => Err(io::Error::other("Failed to detach new process")),
14+
-1 => Err(io::Error::last_os_error()),
1515
_ => Ok(()),
1616
});
1717
}

0 commit comments

Comments
 (0)