(command: &str, args: &[String])
| 1977 | } |
| 1978 | |
| 1979 | fn spawn_mdns_command(command: &str, args: &[String]) -> io::Result<MdnsPublisher> { |
| 1980 | let mut child = ProcessCommand::new(command) |
| 1981 | .args(args) |
| 1982 | .stdin(Stdio::null()) |
| 1983 | .stdout(Stdio::null()) |
| 1984 | .stderr(Stdio::null()) |
| 1985 | .spawn()?; |
| 1986 | |
| 1987 | if let Ok(Some(status)) = child.try_wait() { |
| 1988 | return Err(io::Error::new( |
| 1989 | io::ErrorKind::Other, |
| 1990 | format!("mDNS publisher exited immediately with status {}", status), |
| 1991 | )); |
| 1992 | } |
| 1993 | |
| 1994 | Ok(MdnsPublisher { child }) |
| 1995 | } |
| 1996 | |
| 1997 | fn start_mdns_publisher_if_needed( |
| 1998 | enabled: bool, |
no test coverage detected