(pid: i32)
| 1341 | } |
| 1342 | |
| 1343 | fn wait_for_child(pid: i32) -> Result<libc::c_int, String> { |
| 1344 | let mut status: libc::c_int = 0; |
| 1345 | let rc = unsafe { libc::waitpid(pid, &raw mut status, 0) }; |
| 1346 | if rc < 0 { |
| 1347 | return Err(format!( |
| 1348 | "waitpid({pid}) failed: {}", |
| 1349 | std::io::Error::last_os_error() |
| 1350 | )); |
| 1351 | } |
| 1352 | Ok(status) |
| 1353 | } |
| 1354 | |
| 1355 | fn cleanup_gvproxy(mut guard: Option<GvproxyGuard>) { |
| 1356 | if let Some(mut guard) = guard.take() |