subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Martin <philip.mar...@wandisco.com>
Subject Re: [patch] Support modern network utilities for finding free ports for tests
Date Wed, 10 Jun 2015 13:01:03 GMT
Philip Martin <philip.martin@wandisco.com> writes:

>>> >  HTTPD_PORT=3691
>>> > -while netstat -an | grep $HTTPD_PORT | grep 'LISTEN' >/dev/null; do
>>> > +while \
>>> > +  (ss -ltn sport = :$HTTP_PORT 2>&1 | grep :$HTTP_PORT > /dev/null
) \
>>> > +  || \
>>> > +  (netstat -an 2>&1 | grep $HTTP_PORT | grep 'LISTEN' > /dev/null
) \
>>> > +  do
>
> Looking at it again I'm more worried about the handling of the exit
> statuses in the pipelines.  Different shells have different behaviours.

I think it is probably OK in that regard.  The ambiguity is what should
be returned when multiple commands in a pipeline return non-zero, but
the code is only looking to distinguish two cases: all commands in a
pipeline return zero, one or more commands return non-zero.

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*

Mime
View raw message