Index: network.c =================================================================== --- network.c (revision 24639) +++ network.c (working copy) @@ -896,8 +896,9 @@ GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, const struct GNUNET_NETWORK_FDSet *src) { +#ifndef MINGW int nfds; - + for (nfds = src->nsds; nfds > 0; nfds--) if (FD_ISSET (nfds, &src->sds)) @@ -906,7 +907,17 @@ if (nfds + 1 > dst->nsds) dst->nsds = nfds + 1; } -#ifdef MINGW +#else + int i; + /* Copy all the writes to the except, so we can detect connect() errors */ + for (i = 0; i < src->sds.fd_count; i++) + { + if (src->sds.fd_array[i] != 0 && src->sds.fd_array[i] != -1) + FD_SET (src->sds.fd_array[i], &dst->sds); + + if (src->nsds > dst->nsds) + dst->nsds = src->nsds; + } GNUNET_CONTAINER_slist_append (dst->handles, src->handles); #endif }