mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
tests/jobs.sh: suppress error msg on noncompliant 'ps'
This commit is contained in:
parent
dec10fee6a
commit
8c1e9971a7
1 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ function err_exit
|
|||
let Errors++
|
||||
}
|
||||
alias err_exit='err_exit $LINENO'
|
||||
alias warning='err\_exit $((Errors--,LINENO))'
|
||||
alias warning='err\_exit $((Errors--,LINENO)) warning:'
|
||||
|
||||
Command=${0##*/}
|
||||
integer Errors=0
|
||||
|
@ -79,7 +79,7 @@ kill %+ >out 2>&1 || err_exit "'kill %+' not working in script (got $(printf %q
|
|||
# =====
|
||||
# Before 2021-02-11, job control was deactivated in subshells
|
||||
# https://www.mail-archive.com/austin-group-l@opengroup.org/msg06456.html
|
||||
(sleep 1 & UNIX95=1 ps -o pid=,pgid= -p $!) | IFS=$' \t' read -r pid pgid
|
||||
(sleep 1 & UNIX95=1 command -p ps -o pid=,pgid= -p $! 2>/dev/null) | IFS=$' \t' read -r pid pgid
|
||||
if let "pid>0 && pgid>0" 2>/dev/null
|
||||
then kill $pid
|
||||
let "pgid == pid" || err_exit "background job run in subshell didn't get its own process group ($pgid != $pid)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue