Hi, On Wed, 2015-07-15 at 18:49 +0300, Alexey Kodanev wrote: > Hi, > On 07/09/2015 06:05 AM, Zeng Linggang wrote: > > +int safe_bind(const char *file, const int lineno, void (cleanup_fn)(void), > > + int socket, const struct sockaddr *address, > > + socklen_t address_len) > > +{ > > + int err, ret, i; > > + > > + for (i = 0; i < 30; i++) { > > + ret = bind(socket, address, address_len); > > + err = errno; > > + > > + if (!ret) > > + return 0; > > + > > + tst_resm(TINFO, "bind('%p') failed with %s, try %2i...", > > + address, tst_strerrno(err), i+1); > > + > > I'd wait only if errno is EADDRINUSE; otherwise exit with TBROK > immediately. And waiting for 3 seconds in the loop is too small, please > increase the time. >
Yeah, you are right. It is a typo that I missed one zero. :) Thanks for your comments and best regards, zeng > The rest looks good. > > Thanks, > Alexey ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list