mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-29 08:04:24 +01:00
Use terse output from lsof
This both simplifies parsing a little, and suppresses warnings. Suppressing warnings is both good and bad: on the one hand it resolves problems such as https://github.com/Mbed-TLS/mbedtls/issues/5731, on the other hand it may hide clues as to why lsof wouldn't be working as expected. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
e8133cbecc
commit
36019d5182
@ -696,13 +696,11 @@ if type lsof >/dev/null 2>/dev/null; then
|
|||||||
fi
|
fi
|
||||||
# Make a tight loop, server normally takes less than 1s to start.
|
# Make a tight loop, server normally takes less than 1s to start.
|
||||||
while true; do
|
while true; do
|
||||||
SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -F p)
|
SERVER_PIDS=$(lsof -a -n -b -i "$proto:$1" -t)
|
||||||
# When we use a proxy, it will be listening on the same port we
|
# When we use a proxy, it will be listening on the same port we
|
||||||
# are checking for as well as the server and lsof will list both.
|
# are checking for as well as the server and lsof will list both.
|
||||||
# If multiple PIDs are returned, each one will be on a separate
|
|
||||||
# line, each prepended with 'p'.
|
|
||||||
case ${newline}${SERVER_PIDS}${newline} in
|
case ${newline}${SERVER_PIDS}${newline} in
|
||||||
*${newline}p${2}${newline}*) break;;
|
*${newline}${2}${newline}*) break;;
|
||||||
esac
|
esac
|
||||||
if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then
|
if [ $(( $(date +%s) - $START_TIME )) -gt $DOG_DELAY ]; then
|
||||||
echo "$3 START TIMEOUT"
|
echo "$3 START TIMEOUT"
|
||||||
|
Loading…
Reference in New Issue
Block a user