File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -768,15 +768,18 @@ impl Shell {
768768 if is_process_in_foreground ( ) {
769769 // unwrap should never fail as child is a valid process id and in the
770770 // same session as the shell process
771- while getpgid ( Some ( child) ) . unwrap ( ) . as_raw ( ) as u32 == getgid ( ) . as_raw ( ) {
772- // loop until child is process group leader
771+ let mut child_pgid = getpgid ( Some ( child) ) . unwrap ( ) ;
772+ // loop until child is in another group
773+ while child_pgid. as_raw ( ) as u32 == getgid ( ) . as_raw ( ) {
773774 self . handle_async_events ( ) ;
774775 std:: thread:: sleep ( Duration :: from_millis ( 16 ) ) ;
776+ // cannot fail, same reason as above
777+ child_pgid = getpgid ( Some ( child) ) . unwrap ( ) ;
775778 }
776779 // should never fail as stdin is a valid file descriptor and
777780 // child is a valid group id and is in the same session
778781 // as the shell process
779- tcsetpgrp ( io:: stdin ( ) . as_fd ( ) , child ) . unwrap ( ) ;
782+ tcsetpgrp ( io:: stdin ( ) . as_fd ( ) , child_pgid ) . unwrap ( ) ;
780783 pipeline_exit_status = self . wait_child_process ( child) ?;
781784 // should never fail
782785 tcsetpgrp ( io:: stdin ( ) . as_fd ( ) , getpgrp ( ) ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments