diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 10:46:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 10:46:33 +0000 |
commit | eecbd346302c15d6a66d93f6b12eeffee6d5c473 (patch) | |
tree | ab00e0a52f420d8b74dbd704e923569569218379 | |
parent | ee499cde2f179375c1f897564a16100052388cd3 (diff) | |
download | gnunet-gtk-eecbd346302c15d6a66d93f6b12eeffee6d5c473.tar.gz gnunet-gtk-eecbd346302c15d6a66d93f6b12eeffee6d5c473.zip |
making it compile again after LRN's patch
-rw-r--r-- | contrib/Makefile.in | 4 | ||||
-rw-r--r-- | src/gnunet-gtk.c | 36 |
2 files changed, 21 insertions, 19 deletions
diff --git a/contrib/Makefile.in b/contrib/Makefile.in index d42999f1..480491e8 100644 --- a/contrib/Makefile.in +++ b/contrib/Makefile.in | |||
@@ -149,8 +149,8 @@ GLADE_CFLAGS = @GLADE_CFLAGS@ | |||
149 | GLADE_LIBS = @GLADE_LIBS@ | 149 | GLADE_LIBS = @GLADE_LIBS@ |
150 | GMSGFMT = @GMSGFMT@ | 150 | GMSGFMT = @GMSGFMT@ |
151 | GMSGFMT_015 = @GMSGFMT_015@ | 151 | GMSGFMT_015 = @GMSGFMT_015@ |
152 | GNUNETGTK_CFLAGS = @GNUNETGTK_CFLAGS@ | 152 | GNUNET_CFLAGS = @GNUNET_CFLAGS@ |
153 | GNUNETGTK_LIBS = @GNUNETGTK_LIBS@ | 153 | GNUNET_LIBS = @GNUNET_LIBS@ |
154 | GREP = @GREP@ | 154 | GREP = @GREP@ |
155 | GTK_CFLAGS = @GTK_CFLAGS@ | 155 | GTK_CFLAGS = @GTK_CFLAGS@ |
156 | GTK_LIBS = @GTK_LIBS@ | 156 | GTK_LIBS = @GTK_LIBS@ |
diff --git a/src/gnunet-gtk.c b/src/gnunet-gtk.c index 0784432a..c33fed5e 100644 --- a/src/gnunet-gtk.c +++ b/src/gnunet-gtk.c | |||
@@ -226,14 +226,15 @@ gnunet_gtk_select (void *cls, | |||
226 | guint allocated_nfds, need_gfds; | 226 | guint allocated_nfds, need_gfds; |
227 | 227 | ||
228 | fd_set aread, awrite, aexcept; | 228 | fd_set aread, awrite, aexcept; |
229 | int pre_ret = 0; | ||
230 | int result = 0; | ||
231 | int socks = 0; | ||
232 | int sock_read = 0, sock_write = 0, sock_err = 0; | ||
229 | 233 | ||
230 | #if WINDOWS | 234 | #if WINDOWS |
231 | int always_ready_write_fd = -1; | 235 | int always_ready_write_fd = -1; |
232 | int sock_read = 0, sock_write = 0, sock_err = 0, socks = 0; | ||
233 | 236 | ||
234 | int pre_ret = 0; | ||
235 | int select_ret = 0; | 237 | int select_ret = 0; |
236 | int result = 0; | ||
237 | 238 | ||
238 | int read_handles = 0; | 239 | int read_handles = 0; |
239 | DWORD waitstatus; | 240 | DWORD waitstatus; |
@@ -302,18 +303,18 @@ gnunet_gtk_select (void *cls, | |||
302 | } | 303 | } |
303 | gfds[fd_counter].fd = i; | 304 | gfds[fd_counter].fd = i; |
304 | gfds[fd_counter].events = (isset[0] ? G_IO_IN | G_IO_HUP | G_IO_ERR : 0) | 305 | gfds[fd_counter].events = (isset[0] ? G_IO_IN | G_IO_HUP | G_IO_ERR : 0) |
305 | | (isset[1] ? G_IO_OUT | G_IO_ERR : 0) | (issed[2] ? G_IO_ERR : 0); | 306 | | (isset[1] ? G_IO_OUT | G_IO_ERR : 0) | (isset[2] ? G_IO_ERR : 0); |
306 | fd_counter += 1; | 307 | fd_counter += 1; |
307 | } | 308 | } |
308 | if (need_realloc) | 309 | if (need_realloc) |
309 | { | 310 | { |
310 | mc->cached_poll_array = fds = g_renew (GPollFD, fds, mc->cached_poll_array_size * 2); | 311 | mc->cached_poll_array = gfds = g_renew (GPollFD, gfds, mc->cached_poll_array_size * 2); |
311 | mc->cached_poll_array_size = allocated_nfds = nfds; | 312 | mc->cached_poll_array_size = allocated_nfds = mc->cached_poll_array_size * 2; |
312 | fd_counter = 0; | 313 | fd_counter = 0; |
313 | need_realloc = FALSE; | 314 | need_realloc = FALSE; |
314 | } | 315 | } |
315 | else | 316 | else |
316 | break; | 317 | break; |
317 | #else | 318 | #else |
318 | struct GNUNET_CONTAINER_SList_Iterator *t; | 319 | struct GNUNET_CONTAINER_SList_Iterator *t; |
319 | /* We might overshoot a little, but that won't hurt very much */ | 320 | /* We might overshoot a little, but that won't hurt very much */ |
@@ -473,9 +474,9 @@ gnunet_gtk_select (void *cls, | |||
473 | sock_err = efds->sds.fd_count; | 474 | sock_err = efds->sds.fd_count; |
474 | } | 475 | } |
475 | break; | 476 | break; |
477 | #endif | ||
476 | } | 478 | } |
477 | socks = sock_read + sock_write + sock_err; | 479 | socks = sock_read + sock_write + sock_err; |
478 | #endif | ||
479 | 480 | ||
480 | g_main_context_prepare (mc->gmc, &mc->max_priority); | 481 | g_main_context_prepare (mc->gmc, &mc->max_priority); |
481 | while (allocated_nfds < (need_gfds = g_main_context_query (mc->gmc, | 482 | while (allocated_nfds < (need_gfds = g_main_context_query (mc->gmc, |
@@ -522,20 +523,20 @@ gnunet_gtk_select (void *cls, | |||
522 | 523 | ||
523 | #if !WINDOWS | 524 | #if !WINDOWS |
524 | if (rfds) | 525 | if (rfds) |
525 | FD_ZERO (rfds); | 526 | GNUNET_NETWORK_fdset_zero (rfds); |
526 | if (wfds) | 527 | if (wfds) |
527 | FD_ZERO (wfds); | 528 | GNUNET_NETWORK_fdset_zero (wfds); |
528 | if (efds) | 529 | if (efds) |
529 | FD_ZERO (efds); | 530 | GNUNET_NETWORK_fdset_zero (efds); |
530 | for (i = 0; i < fd_counter; i++) | 531 | for (i = 0; i < fd_counter; i++) |
531 | { | 532 | { |
532 | int set[3]; | 533 | int set[3]; |
533 | if (set[0] = FD_ISSET (gfds[i].fd, &aread)) | 534 | if ((set[0] = FD_ISSET (gfds[i].fd, &aread))) |
534 | FD_SET (gfds[i].fd, rfds->sds); | 535 | FD_SET (gfds[i].fd, &rfds->sds); |
535 | if (set[1] = FD_ISSET (gfds[i].fd, &awrite)) | 536 | if ((set[1] = FD_ISSET (gfds[i].fd, &awrite))) |
536 | FD_SET (gfds[i].fd, wfds->sds); | 537 | FD_SET (gfds[i].fd, &wfds->sds); |
537 | if (set[2] = FD_ISSET (gfds[i].fd, &aexcept)) | 538 | if ((set[2] = FD_ISSET (gfds[i].fd, &aexcept))) |
538 | FD_SET (gfds[i].fd, efds->sds); | 539 | FD_SET (gfds[i].fd, &efds->sds); |
539 | if (set[0] || set[1] || set[2]) | 540 | if (set[0] || set[1] || set[2]) |
540 | result += 1; | 541 | result += 1; |
541 | } | 542 | } |
@@ -684,6 +685,7 @@ gnunet_gtk_select (void *cls, | |||
684 | } | 685 | } |
685 | 686 | ||
686 | 687 | ||
688 | |||
687 | /** | 689 | /** |
688 | * Get the name of the directory where all of our package | 690 | * Get the name of the directory where all of our package |
689 | * data is stored ($PREFIX/share/) | 691 | * data is stored ($PREFIX/share/) |