aboutsummaryrefslogtreecommitdiff
path: root/src/util/scheduler.c
diff options
context:
space:
mode:
authorlurchi <lurchi@strangeplace.net>2017-07-20 18:04:02 +0200
committerlurchi <lurchi@strangeplace.net>2017-07-20 18:04:31 +0200
commit7f843df63bd3d1a85d687f3e0de23594b43af6d3 (patch)
treefc04058ba62708be2fd4c5b4a85885255dfff26b /src/util/scheduler.c
parenta9d92c556d88da778dcde68114cd21b36d6db539 (diff)
downloadgnunet-7f843df63bd3d1a85d687f3e0de23594b43af6d3.tar.gz
gnunet-7f843df63bd3d1a85d687f3e0de23594b43af6d3.zip
small fixes
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r--src/util/scheduler.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index e27eb0fe0..1275a684b 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -234,7 +234,7 @@ struct GNUNET_SCHEDULER_Task
234 * #GNUNET_SCHEDULER_add_select(), #add_without_sets() and 234 * #GNUNET_SCHEDULER_add_select(), #add_without_sets() and
235 * #GNUNET_SCHEDULER_cancel(). 235 * #GNUNET_SCHEDULER_cancel().
236 */ 236 */
237GNUNET_SCHEDULER_Driver *scheduler_driver; 237static struct GNUNET_SCHEDULER_Driver *scheduler_driver;
238 238
239/** 239/**
240 * Head of list of tasks waiting for an event. 240 * Head of list of tasks waiting for an event.
@@ -1055,16 +1055,22 @@ GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p)
1055 * @param task id of the task to cancel 1055 * @param task id of the task to cancel
1056 * @return original closure of the task 1056 * @return original closure of the task
1057 */ 1057 */
1058void initFdINfo(GNUNET_SCHEDULER_FdInfo *fdi, struct GNUNET_SCHEDULER_Task *task) 1058void initFdInfo(struct GNUNET_SCHEDULER_FdInfo *fdi, struct GNUNET_SCHEDULER_Task *task)
1059{ 1059{
1060 if (-1 != task->read_fd) 1060 if (-1 != task->read_fd)
1061 { 1061 {
1062 fdi->sock=task->read_fd; 1062 fdi->sock=task->read_fd;
1063 }else if (-1 != task->write_fd){ 1063 }
1064 else if (-1 != task->write_fd)
1065 {
1064 fdi->sock=task->write_fd; 1066 fdi->sock=task->write_fd;
1065 } else if (NULL != task->read_set){ 1067 }
1068 else if (NULL != task->read_set)
1069 {
1066 fdi->fd=task->read_set; 1070 fdi->fd=task->read_set;
1067 }else if (NULL != task->write_set){ 1071 }
1072 else if (NULL != task->write_set)
1073 {
1068 fdi->fd=task->write_set; 1074 fdi->fd=task->write_set;
1069 } 1075 }
1070} 1076}
@@ -1102,7 +1108,7 @@ GNUNET_SCHEDULER_cancel (struct GNUNET_SCHEDULER_Task *task)
1102 pending_tail, 1108 pending_tail,
1103 task);*/ 1109 task);*/
1104 fdi = GNUNET_new (struct GNUNET_SCHEDULER_FdInfo); 1110 fdi = GNUNET_new (struct GNUNET_SCHEDULER_FdInfo);
1105 initFdINfo(fdi, task); 1111 initFdInfo(fdi, task);
1106 scheduler_driver->del(scheduler_driver->cls, task, fdi); 1112 scheduler_driver->del(scheduler_driver->cls, task, fdi);
1107 } 1113 }
1108 } 1114 }
@@ -1528,8 +1534,8 @@ add_without_sets (struct GNUNET_TIME_Relative delay,
1528 pending_tail, 1534 pending_tail,
1529 t);*/ 1535 t);*/
1530 fdi = GNUNET_new (struct GNUNET_SCHEDULER_FdInfo); 1536 fdi = GNUNET_new (struct GNUNET_SCHEDULER_FdInfo);
1531 initFdINfo(fdi, task); 1537 initFdInfo(fdi, t);
1532 scheduler_driver->add(scheduler_driver, t , fdi); 1538 scheduler_driver->add(scheduler_driver->cls, t , fdi);
1533 max_priority_added = GNUNET_MAX (max_priority_added, 1539 max_priority_added = GNUNET_MAX (max_priority_added,
1534 t->priority); 1540 t->priority);
1535 LOG (GNUNET_ERROR_TYPE_DEBUG, 1541 LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -1851,8 +1857,8 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio,
1851 pending_tail, 1857 pending_tail,
1852 t);*/ 1858 t);*/
1853 fdi = GNUNET_new (struct GNUNET_SCHEDULER_FdInfo); 1859 fdi = GNUNET_new (struct GNUNET_SCHEDULER_FdInfo);
1854 initFdINfo(fdi, task); 1860 initFdInfo(fdi, t);
1855 scheduler_driver->add(scheduler_driver, t , fdi); 1861 scheduler_driver->add(scheduler_driver->cls, t , fdi);
1856 max_priority_added = GNUNET_MAX (max_priority_added, 1862 max_priority_added = GNUNET_MAX (max_priority_added,
1857 t->priority); 1863 t->priority);
1858 LOG (GNUNET_ERROR_TYPE_DEBUG, 1864 LOG (GNUNET_ERROR_TYPE_DEBUG,