diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-13 15:47:56 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-13 15:47:56 +0000 |
commit | 16fca3835b569ed8427d786e3cdb95dc01ceb342 (patch) | |
tree | b25aa6f30ec5d936da5bb48307f087c08a6a0772 /src/util/network.c | |
parent | 3ec976177fd1a437f0a1a2411eef3620f619c8e3 (diff) | |
download | gnunet-16fca3835b569ed8427d786e3cdb95dc01ceb342.tar.gz gnunet-16fca3835b569ed8427d786e3cdb95dc01ceb342.zip |
-fix off-by-one so we can also select on FD 0 (stdin)
Diffstat (limited to 'src/util/network.c')
-rw-r--r-- | src/util/network.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/util/network.c b/src/util/network.c index 00f6ebf3b..de53470c1 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -988,7 +988,7 @@ GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | |||
988 | #ifndef MINGW | 988 | #ifndef MINGW |
989 | int nfds; | 989 | int nfds; |
990 | 990 | ||
991 | for (nfds = src->nsds; nfds > 0; nfds--) | 991 | for (nfds = src->nsds; nfds >= 0; nfds--) |
992 | if (FD_ISSET (nfds, &src->sds)) | 992 | if (FD_ISSET (nfds, &src->sds)) |
993 | 993 | ||
994 | { | 994 | { |
@@ -1310,6 +1310,7 @@ _selector (LPVOID p) | |||
1310 | 1310 | ||
1311 | /** | 1311 | /** |
1312 | * Check if sockets or pipes meet certain conditions | 1312 | * Check if sockets or pipes meet certain conditions |
1313 | * | ||
1313 | * @param rfds set of sockets or pipes to be checked for readability | 1314 | * @param rfds set of sockets or pipes to be checked for readability |
1314 | * @param wfds set of sockets or pipes to be checked for writability | 1315 | * @param wfds set of sockets or pipes to be checked for writability |
1315 | * @param efds set of sockets or pipes to be checked for exceptions | 1316 | * @param efds set of sockets or pipes to be checked for exceptions |
@@ -1423,8 +1424,7 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
1423 | { | 1424 | { |
1424 | GNUNET_break (0); | 1425 | GNUNET_break (0); |
1425 | LOG (GNUNET_ERROR_TYPE_ERROR, | 1426 | LOG (GNUNET_ERROR_TYPE_ERROR, |
1426 | _ | 1427 | _("Fatal internal logic error, process hangs in `%s' (abort with CTRL-C)!\n"), |
1427 | ("Fatal internal logic error, process hangs in `%s' (abort with CTRL-C)!\n"), | ||
1428 | "select"); | 1428 | "select"); |
1429 | } | 1429 | } |
1430 | #ifndef MINGW | 1430 | #ifndef MINGW |