'-F' option now needs locked pidfile. Modify regression tests respectively.
This commit is contained in:
parent
712bf6af16
commit
dfe47d36df
@ -9,16 +9,15 @@ name="pgrep -F <pidfile>"
|
|||||||
pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
|
sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
ln -sf /bin/sleep $sleep
|
ln -sf /bin/sleep $sleep
|
||||||
$sleep 5 &
|
daemon -p $pidfile $sleep 5
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
chpid=$!
|
chpid=`cat $pidfile`
|
||||||
echo $chpid > $pidfile
|
|
||||||
pid=`pgrep -f -F $pidfile $sleep`
|
pid=`pgrep -f -F $pidfile $sleep`
|
||||||
if [ "$pid" = "$chpid" ]; then
|
if [ "$pid" = "$chpid" ]; then
|
||||||
echo "ok - $name"
|
echo "ok - $name"
|
||||||
else
|
else
|
||||||
echo "not ok - $name"
|
echo "not ok - $name"
|
||||||
fi
|
fi
|
||||||
kill $chpid
|
kill "$chpid"
|
||||||
rm -f $pidfile
|
rm -f $pidfile
|
||||||
rm -f $sleep
|
rm -f $sleep
|
||||||
|
@ -9,9 +9,8 @@ name="pkill -F <pidfile>"
|
|||||||
pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
pidfile=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
|
sleep=`mktemp /tmp/$base.XXXXXX` || exit 1
|
||||||
ln -sf /bin/sleep $sleep
|
ln -sf /bin/sleep $sleep
|
||||||
$sleep 5 &
|
daemon -p $pidfile $sleep 5
|
||||||
sleep 0.3
|
sleep 0.3
|
||||||
echo $! > $pidfile
|
|
||||||
pkill -f -F $pidfile $sleep
|
pkill -f -F $pidfile $sleep
|
||||||
ec=$?
|
ec=$?
|
||||||
case $ec in
|
case $ec in
|
||||||
|
Loading…
Reference in New Issue
Block a user