"Bert Huijben" <[email protected]> writes:

>> -----Original Message-----
>> From: Philip Martin [mailto:[email protected]]
>> Sent: woensdag 10 juni 2015 14:05
>> To: Andreas Stieger
>> Cc: [email protected]
>> Subject: Re: [patch] Support modern network utilities for finding free
> ports for
>> tests
>> 
>> Andreas Stieger <[email protected]> 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*

Reply via email to