Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: install dependencies
run: brew install pkg-config libtool autoconf automake groff
run: brew install libtool autoconf automake
- name: configure
run: LSOF_INCLUDE=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include ./Configure -n darwin
- name: make
Expand All @@ -42,18 +42,17 @@ jobs:
run: |
git clean -fdx .
autoreconf -vif
./configure
./configure --disable-manpages
make
DESTDIR=$PWD/prefix make install
make check
- name: dist build and test
run: |
make dist
mkdir temp
cd temp
tar xvf ../lsof-*.tar.gz
cd lsof-*
./configure
./configure --disable-manpages
make
DESTDIR=$PWD/prefix make install
make check
Expand Down
27 changes: 19 additions & 8 deletions tests/case-23-multi-address-hostname.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,30 @@ if ! command -v python3 >/dev/null 2>&1; then
fi

host=$(hostname)
# Resolving a .local host name through mDNS can block for a long time on some
# machines, so cap the lookup and treat a timeout as "no addresses".
naddr=$(python3 - "$host" <<'PY'
import os
import socket
import sys
import threading

host = sys.argv[1]
count = 0
for family in (socket.AF_INET, socket.AF_INET6):
try:
infos = socket.getaddrinfo(host, None, family, socket.SOCK_STREAM)
except OSError:
continue
count = max(count, len({info[4][0] for info in infos}))
print(count)
count = [0]

def resolve():
for family in (socket.AF_INET, socket.AF_INET6):
try:
infos = socket.getaddrinfo(host, None, family, socket.SOCK_STREAM)
except OSError:
continue
count[0] = max(count[0], len({info[4][0] for info in infos}))

resolver = threading.Thread(target=resolve, daemon=True)
resolver.start()
resolver.join(5)
print(count[0], flush=True)
os._exit(0)
PY
)

Expand Down
Loading