From: Christian Grothoff Date: Fri, 2 Oct 2009 12:52:50 +0000 (+0000) Subject: detect hanging select X-Git-Tag: initial-import-from-subversion-38251~23424 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fcd40dcd667f5f173c5f810c2cc196942ac8142c;p=oweals%2Fgnunet.git detect hanging select --- diff --git a/src/util/network.c b/src/util/network.c index 2deb0261c..f2c1faa4b 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -643,6 +643,14 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, tv.tv_sec = timeout.value / GNUNET_TIME_UNIT_SECONDS.value; tv.tv_usec = 1000 * (timeout.value - (tv.tv_sec * GNUNET_TIME_UNIT_SECONDS.value)); + if ( (nfds == 0) && + (timeout.value == GNUNET_TIME_UNIT_FOREVER_REL.value) ) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + _("Fatal internal logic error, process hangs in `%s' (abort with CTRL-C)!\n"), + "select"); + GNUNET_break (0); + } return select (nfds + 1, (rfds != NULL) ? &rfds->sds : NULL, (wfds != NULL) ? &wfds->sds : NULL,