diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-07-09 14:44:21 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-07-09 14:44:21 +0000 |
commit | 8226d9807819dbbc4b05751f4cdd09603832367d (patch) | |
tree | 6da67f9d305313e71d3eed33409a42456a93c955 | |
parent | 0e9c5725285236633f63363a649e62b890a915b6 (diff) | |
download | gnunet-8226d9807819dbbc4b05751f4cdd09603832367d.tar.gz gnunet-8226d9807819dbbc4b05751f4cdd09603832367d.zip |
Fixed compile warnings under windows
-rw-r--r-- | src/util/network.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/util/network.c b/src/util/network.c index 101e794d0..2d59b46dd 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -175,10 +175,15 @@ socket_set_nosigpipe (const struct GNUNET_NETWORK_Handle *h) | |||
175 | static void | 175 | static void |
176 | socket_set_nodelay (const struct GNUNET_NETWORK_Handle *h) | 176 | socket_set_nodelay (const struct GNUNET_NETWORK_Handle *h) |
177 | { | 177 | { |
178 | #ifndef WINDOWS | ||
178 | int value = 1; | 179 | int value = 1; |
179 | if (0 != | 180 | if (0 != setsockopt (h->fd, IPPROTO_TCP, TCP_NODELAY, &value, sizeof (value))) |
180 | setsockopt (h->fd, IPPROTO_TCP, TCP_NODELAY, &value, sizeof (value))) | 181 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt"); |
182 | #else | ||
183 | const char * value = "1"; | ||
184 | if (0 != setsockopt (h->fd, IPPROTO_TCP, TCP_NODELAY, value, sizeof (value))) | ||
181 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt"); | 185 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "setsockopt"); |
186 | #endif | ||
182 | } | 187 | } |
183 | 188 | ||
184 | 189 | ||
@@ -411,13 +416,14 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle | |||
411 | *desc) | 416 | *desc) |
412 | { | 417 | { |
413 | int error; | 418 | int error; |
414 | int pending; | ||
415 | 419 | ||
416 | /* How much is there to be read? */ | 420 | /* How much is there to be read? */ |
417 | #ifndef WINDOWS | 421 | #ifndef WINDOWS |
422 | int pending; | ||
418 | error = ioctl (desc->fd, FIONREAD, &pending); | 423 | error = ioctl (desc->fd, FIONREAD, &pending); |
419 | if (error == 0) | 424 | if (error == 0) |
420 | #else | 425 | #else |
426 | u_long pending; | ||
421 | error = ioctlsocket (desc->fd, FIONREAD, &pending); | 427 | error = ioctlsocket (desc->fd, FIONREAD, &pending); |
422 | if (error != SOCKET_ERROR) | 428 | if (error != SOCKET_ERROR) |
423 | #endif | 429 | #endif |
@@ -876,7 +882,7 @@ GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | |||
876 | { | 882 | { |
877 | HANDLE *h; | 883 | HANDLE *h; |
878 | 884 | ||
879 | h = GNUNET_CONTAINER_slist_get (it, NULL); | 885 | h = (HANDLE *) GNUNET_CONTAINER_slist_get ((const struct GNUNET_CONTAINER_SList_Iterator *)it, NULL); |
880 | if (GNUNET_CONTAINER_slist_contains | 886 | if (GNUNET_CONTAINER_slist_contains |
881 | (fds2->handles, h, sizeof (HANDLE))) | 887 | (fds2->handles, h, sizeof (HANDLE))) |
882 | { | 888 | { |