[packages] add asterisk-1.8.x, patch from zandbelt
[openwrt/svn-archive/archive.git] / net / wput / patches / 100-socketlib.diff
1 --- a/src/socketlib.c
2 +++ b/src/socketlib.c
3 @@ -392,17 +392,15 @@ int socket_is_data_readable(int s, int t
4 wput_socket * socket_timeout_connect(wput_socket * sock, struct sockaddr *remote_addr, size_t size, int timeout) {
5 int c = 0;
6 printout(vDEBUG, "initiating timeout connect (%d)\n", timeout);
7 -#ifdef WIN32
8 /* reset errno before connecting. otherwise connection might "fail" for:
9 * no such file or directory ;) */
10 errno = 0;
11 -#endif
12 - socket_set_blocking(sock->fd, 0);
13 + socket_set_blocking(sock->fd, 1);
14 c = connect(sock->fd,remote_addr,size);
15 /* here was a check also for errno != 36 (FILENAMETOOLONG)
16 * maybe this was EINPROGRESS on another system? */
17 if(errno > 0 && errno != EINPROGRESS) {
18 - printout(vMORE, "[%s]", strerror(errno));
19 + printout(vMORE, "[%d:%s] ", errno, strerror(errno));
20 return NULL;
21 }
22 /* DEBUG if(c == -1) perror("connect"); */