[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r13798 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r13798 - gnunet/src/util |
Date: |
Wed, 24 Nov 2010 20:41:11 +0100 |
Author: durner
Date: 2010-11-24 20:41:11 +0100 (Wed, 24 Nov 2010)
New Revision: 13798
Modified:
gnunet/src/util/network.c
gnunet/src/util/scheduler.c
Log:
fix MINGW
Modified: gnunet/src/util/network.c
===================================================================
--- gnunet/src/util/network.c 2010-11-24 16:34:32 UTC (rev 13797)
+++ gnunet/src/util/network.c 2010-11-24 19:41:11 UTC (rev 13798)
@@ -835,11 +835,9 @@
const struct GNUNET_DISK_FileHandle *h)
{
#ifdef MINGW
- HANDLE hw;
- GNUNET_DISK_internal_file_handle_ (h, &hw, sizeof (HANDLE));
GNUNET_CONTAINER_slist_add (fds->handles,
GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
- &hw, sizeof (HANDLE));
+ h, sizeof (struct GNUNET_DISK_FileHandle));
#else
int fd;
@@ -852,24 +850,7 @@
}
-#if MINGW
/**
- * Add a W32 file handle to the fd set
- * @param fds fd set
- * @param h the file handle to add
- */
-void
-GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet
*fds,
- HANDLE h)
-{
- GNUNET_CONTAINER_slist_add (fds->handles,
- GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT,
- &h, sizeof (HANDLE));
-}
-#endif
-
-
-/**
* Check if a file handle is part of an fd set
* @param fds fd set
* @param h file handle
@@ -881,8 +862,8 @@
{
#ifdef MINGW
- return GNUNET_CONTAINER_slist_contains (fds->handles, &h->h,
- sizeof (HANDLE));
+ return GNUNET_CONTAINER_slist_contains (fds->handles, h,
+ sizeof (struct
GNUNET_DISK_FileHandle));
#else
return FD_ISSET (h->fd, &fds->sds);
#endif
@@ -913,7 +894,7 @@
}
#else
struct GNUNET_CONTAINER_SList_Iterator *it;
- HANDLE *h;
+ struct GNUNET_DISK_FileHandle *h;
int i;
int j;
@@ -931,9 +912,9 @@
it = GNUNET_CONTAINER_slist_begin (fds1->handles);
while (GNUNET_CONTAINER_slist_end (it) != GNUNET_YES)
{
- h = (HANDLE *) GNUNET_CONTAINER_slist_get (it, NULL);
+ h = (struct GNUNET_DISK_FileHandle *) GNUNET_CONTAINER_slist_get (it,
NULL);
if (GNUNET_CONTAINER_slist_contains
- (fds2->handles, h, sizeof (HANDLE)))
+ (fds2->handles, h, sizeof (struct GNUNET_DISK_FileHandle)))
{
GNUNET_CONTAINER_slist_iter_destroy (it);
return GNUNET_YES;
Modified: gnunet/src/util/scheduler.c
===================================================================
--- gnunet/src/util/scheduler.c 2010-11-24 16:34:32 UTC (rev 13797)
+++ gnunet/src/util/scheduler.c 2010-11-24 19:41:11 UTC (rev 13798)
@@ -1194,6 +1194,7 @@
* @return unique task identifier for the job
* only valid until "task" is started!
*/
+#ifndef MINGW
GNUNET_SCHEDULER_TaskIdentifier
add_without_sets (struct GNUNET_TIME_Relative delay,
int rfd,
@@ -1243,6 +1244,7 @@
#endif
return t->id;
}
+#endif
@@ -1267,11 +1269,25 @@
struct GNUNET_NETWORK_Handle * rfd,
GNUNET_SCHEDULER_Task task, void *task_cls)
{
+#if MINGW
+ struct GNUNET_NETWORK_FDSet *rs;
+ GNUNET_SCHEDULER_TaskIdentifier ret;
+
+ GNUNET_assert (rfd != NULL);
+ rs = GNUNET_NETWORK_fdset_create ();
+ GNUNET_NETWORK_fdset_set (rs, rfd);
+ ret = GNUNET_SCHEDULER_add_select (check_priority (current_priority),
+ GNUNET_SCHEDULER_NO_TASK, delay,
+ rs, NULL, task, task_cls);
+ GNUNET_NETWORK_fdset_destroy (rs);
+ return ret;
+#else
return add_without_sets (delay,
GNUNET_NETWORK_get_fd (rfd),
-1,
task,
task_cls);
+#endif
}
@@ -1296,11 +1312,25 @@
struct GNUNET_NETWORK_Handle * wfd,
GNUNET_SCHEDULER_Task task, void *task_cls)
{
+#if MINGW
+ struct GNUNET_NETWORK_FDSet *ws;
+ GNUNET_SCHEDULER_TaskIdentifier ret;
+
+ GNUNET_assert (wfd != NULL);
+ ws = GNUNET_NETWORK_fdset_create ();
+ GNUNET_NETWORK_fdset_set (ws, wfd);
+ ret = GNUNET_SCHEDULER_add_select (check_priority (current_priority),
+ GNUNET_SCHEDULER_NO_TASK, delay,
+ NULL, ws, task, task_cls);
+ GNUNET_NETWORK_fdset_destroy (ws);
+ return ret;
+#else
return add_without_sets (delay,
-1,
GNUNET_NETWORK_get_fd (wfd),
task,
task_cls);
+#endif
}
@@ -1332,7 +1362,7 @@
GNUNET_assert (rfd != NULL);
rs = GNUNET_NETWORK_fdset_create ();
GNUNET_NETWORK_fdset_handle_set (rs, rfd);
- ret = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_KEEP,
+ ret = GNUNET_SCHEDULER_add_select (check_priority (current_priority),
GNUNET_SCHEDULER_NO_TASK, delay,
rs, NULL, task, task_cls);
GNUNET_NETWORK_fdset_destroy (rs);
@@ -1379,7 +1409,7 @@
GNUNET_assert (wfd != NULL);
ws = GNUNET_NETWORK_fdset_create ();
GNUNET_NETWORK_fdset_handle_set (ws, wfd);
- ret = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_KEEP,
+ ret = GNUNET_SCHEDULER_add_select (check_priority (current_priority),
GNUNET_SCHEDULER_NO_TASK,
delay, NULL, ws, task, task_cls);
GNUNET_NETWORK_fdset_destroy (ws);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r13798 - gnunet/src/util,
gnunet <=