File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ impl PtyProcess {
126126 flags. local_flags &= !termios:: LocalFlags :: ECHO ;
127127 termios:: tcsetattr ( & stdin, termios:: SetArg :: TCSANOW , & flags) ?;
128128
129- command. exec ( ) ;
129+ let _ = command. exec ( ) ;
130130 Err ( Error :: Nix ( nix:: Error :: last ( ) ) )
131131 }
132132 ForkResult :: Parent { child : child_pid } => Ok ( PtyProcess {
@@ -173,11 +173,7 @@ impl PtyProcess {
173173 /// ```
174174 ///
175175 pub fn status ( & self ) -> Option < wait:: WaitStatus > {
176- if let Ok ( status) = wait:: waitpid ( self . child_pid , Some ( wait:: WaitPidFlag :: WNOHANG ) ) {
177- Some ( status)
178- } else {
179- None
180- }
176+ wait:: waitpid ( self . child_pid , Some ( wait:: WaitPidFlag :: WNOHANG ) ) . ok ( )
181177 }
182178
183179 /// Wait until process has exited. This is a blocking call.
@@ -188,7 +184,7 @@ impl PtyProcess {
188184
189185 /// Regularly exit the process, this method is blocking until the process is dead
190186 pub fn exit ( & mut self ) -> Result < wait:: WaitStatus , Error > {
191- self . kill ( signal:: SIGTERM ) . map_err ( Error :: from )
187+ self . kill ( signal:: SIGTERM )
192188 }
193189
194190 /// Non-blocking variant of `kill()` (doesn't wait for process to be killed)
You can’t perform that action at this time.
0 commit comments