[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [patch] Support modern network utilities for finding free ports for tests

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 10 Jun 2015 14:01:03 +0100

Philip Martin <philip.martin_at_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*
Received on 2015-06-10 15:01:24 CEST

This is an archived mail posted to the Subversion Dev mailing list.