Re: connect_sync

2016-08-19 Thread Todd C. Miller
On Fri, 19 Aug 2016 19:14:54 -0400, "Ted Unangst" wrote: > hmm. so I was trying to avoid the need for two different functions. I think > there's a mental overhead to "do this, then maybe that". this loop reads > very strangely to me. it's hard to mentally trace the code. it's not really a > loop,

Re: connect_sync

2016-08-19 Thread Ted Unangst
Todd C. Miller wrote: > Here's a rewrite of my connect_sync() changes to use connect_wait() > instead. Unlike the version in the connect(2) manual, this one > returns EINTR when interrupted by a signal which is probably better. > Index: usr.bin/ftp/fetch.c >

Re: connect_sync

2016-08-19 Thread Todd C. Miller
Here's a rewrite of my connect_sync() changes to use connect_wait() instead. Unlike the version in the connect(2) manual, this one returns EINTR when interrupted by a signal which is probably better. - todd Index: usr.bin/ftp/extern.h

Re: connect_sync

2016-08-19 Thread Todd C. Miller
Another option is to use the connect_wait() function I added to EXAMPLES in connect(2). You would only call it if connect(2) returns -1 with errno == EINTR. - todd