X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Futil%2Fnetwork.c;h=8ec365269dd5b003ffce0a9407b19edaf4a20c8d;hb=d47f834c1f2de41c9fba74a4b6928e7c8e0679e0;hp=c4fb73049e19718a7b9bdc8974da58dbd2597b48;hpb=c9b7c04b1c4d6fc15225b5ba860b6e49c707ea6a;p=oweals%2Fgnunet.git diff --git a/src/util/network.c b/src/util/network.c index c4fb73049..8ec365269 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -226,7 +226,10 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, #ifdef DARWIN socket_set_nosigpipe (ret); #endif - socket_set_nodelay (ret); +#ifdef AF_UNIX + if (address->sa_family != AF_UNIX) +#endif + socket_set_nodelay (ret); return ret; } @@ -590,7 +593,11 @@ GNUNET_NETWORK_socket_create (int domain, int type, int protocol) #ifdef DARWIN socket_set_nosigpipe (ret); #endif - if (type == SOCK_STREAM) + if ( (type == SOCK_STREAM) +#ifdef AF_UNIX + && (domain != AF_UNIX) +#endif + ) socket_set_nodelay (ret); return ret; } @@ -723,6 +730,21 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, to->nsds = nfds; } + +/** + * Set a native fd in a set + * + * @param to destination + * @param nfd native FD to set + */ +void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, + int nfd) +{ + FD_SET (nfd, &to->sds); + to->nsds = GNUNET_MAX (nfd + 1, to->nsds); +} + + /** * Add a file handle to the fd set * @param fds fd set