mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-13 11:42:21 +00:00
test/jobs.sh: use slightly more widely supported ps -o format
This commit is contained in:
parent
5be585f45b
commit
786a549e49
1 changed files with 1 additions and 1 deletions
|
@ -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
|
# Before 2021-02-11, job control was deactivated in subshells
|
||||||
# https://www.mail-archive.com/austin-group-l@opengroup.org/msg06456.html
|
# https://www.mail-archive.com/austin-group-l@opengroup.org/msg06456.html
|
||||||
(sleep 1 & UNIX95=1 command -p ps -o pid=,pgid= -p $! 2>/dev/null) | IFS=$' \t' read -r pid pgid
|
(sleep 1 & UNIX95=1 command -p ps -o pid= -o pgid= -p $! 2>/dev/null) | IFS=$' \t' read -r pid pgid
|
||||||
if let "pid>0 && pgid>0" 2>/dev/null
|
if let "pid>0 && pgid>0" 2>/dev/null
|
||||||
then kill $pid
|
then kill $pid
|
||||||
let "pgid == pid" || err_exit "background job run in subshell didn't get its own process group ($pgid != $pid)"
|
let "pgid == pid" || err_exit "background job run in subshell didn't get its own process group ($pgid != $pid)"
|
||||||
|
|
Loading…
Reference in a new issue