@@ -778,17 +778,22 @@ impl Shell {
778
778
if is_process_in_foreground ( ) {
779
779
// should never fail as child is a valid process id and
780
780
// in the same session as the current shell
781
- let child_gpid = getpgid ( child) . unwrap ( ) ;
781
+ let child_gpid = getpgid ( child)
782
+ . expect ( "failed to get process id of child process" ) ;
782
783
// should never fail as stdin is a valid file descriptor and
783
784
// child gpid is valid and in the same session
784
- tcsetpgrp ( io:: stdin ( ) . as_raw_fd ( ) , child_gpid) . unwrap ( ) ;
785
- kill ( child, Some ( Signal :: SigCont ) ) . unwrap ( ) ;
785
+ tcsetpgrp ( io:: stdin ( ) . as_raw_fd ( ) , child_gpid)
786
+ . expect ( "failed to set pipeline in foreground" ) ;
787
+ kill ( child, Some ( Signal :: SigCont ) )
788
+ . expect ( "failed to start pipeline" ) ;
786
789
pipeline_exit_status = self . wait_child_process ( child) ?;
787
790
// should never fail
788
- tcsetpgrp ( io:: stdin ( ) . as_raw_fd ( ) , getpgrp ( ) ) . unwrap ( ) ;
791
+ tcsetpgrp ( io:: stdin ( ) . as_raw_fd ( ) , getpgrp ( ) )
792
+ . expect ( "failed to reset foreground process" ) ;
789
793
break ;
790
794
} else {
791
- kill ( child, Some ( Signal :: SigCont ) ) . unwrap ( ) ;
795
+ kill ( child, Some ( Signal :: SigCont ) )
796
+ . expect ( "failed start pipeline" ) ;
792
797
pipeline_exit_status = self . wait_child_process ( child) ?;
793
798
break ;
794
799
}
0 commit comments