"Bert Huijben" <bert_at_qqmail.nl> writes:
>> -----Original Message-----
>> From: Philip Martin [mailto:philip.martin_at_wandisco.com]
>> Sent: woensdag 10 juni 2015 14:05
>> To: Andreas Stieger
>> Cc: dev_at_subversion.apache.org
>> Subject: Re: [patch] Support modern network utilities for finding free
> ports for
>> tests
>>
>> Andreas Stieger <andreas.stieger_at_gmx.de> 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
>>
>> You have HTTP_PORT where it should be HTTPD_PORT. I fixed that and
>> committed r1684649. Thanks!
>
> Shouldn't the default be the other way around?... Stick to using netstat
> unless it doesn't exist?
I don't think it makes a lot of difference in this case: it tries to run
one and if that doesn't work it runs the other. I don't see that it
matters which one we prefer unless efficiency of starting processes is a
concern.
Looking at it again I'm more worried about the handling of the exit
statuses in the pipelines. Different shells have different behaviours.
--
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*
Received on 2015-06-10 14:32:15 CEST