1
0
Fork 0
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:
Martijn Dekker 2021-02-15 15:41:31 +00:00
parent 5be585f45b
commit 786a549e49

View file

@ -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 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
then kill $pid
let "pgid == pid" || err_exit "background job run in subshell didn't get its own process group ($pgid != $pid)"