equal
deleted
inserted
replaced
65 Ok(pin) |
65 Ok(pin) |
66 } |
66 } |
67 |
67 |
68 async fn run_system(&mut self, spec: &CommandSpec) -> io::Result<i32> { |
68 async fn run_system(&mut self, spec: &CommandSpec) -> io::Result<i32> { |
69 let status = new_shell_command(&spec).spawn()?.await?; |
69 let status = new_shell_command(&spec).spawn()?.await?; |
70 // TODO: unindent |
70 let code = status |
71 { |
71 .code() |
72 { |
72 .or_else(|| status.signal().map(|n| -n)) |
73 let code = status |
73 .expect("either exit code or signal should be set"); |
74 .code() |
74 Ok(code) |
75 .or_else(|| status.signal().map(|n| -n)) |
|
76 .expect("either exit code or signal should be set"); |
|
77 Ok(code) |
|
78 } |
|
79 } |
|
80 } |
75 } |
81 } |
76 } |
82 |
77 |
83 fn new_shell_command(spec: &CommandSpec) -> Command { |
78 fn new_shell_command(spec: &CommandSpec) -> Command { |
84 let mut builder = Command::new("/bin/sh"); |
79 let mut builder = Command::new("/bin/sh"); |