summaryrefslogtreecommitdiff
path: root/src/util/scheduler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/scheduler.c')
-rw-r--r--src/util/scheduler.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/util/scheduler.c b/src/util/scheduler.c
index 4bea5bd5d..f379bce42 100644
--- a/src/util/scheduler.c
+++ b/src/util/scheduler.c
@@ -108,7 +108,6 @@ struct GNUNET_SCHEDULER_Handle {
108 struct GNUNET_SIGNAL_Context *shc_gterm; 108 struct GNUNET_SIGNAL_Context *shc_gterm;
109#endif 109#endif
110 110
111#ifndef MINGW
112 /** 111 /**
113 * context of the SIGQUIT handler 112 * context of the SIGQUIT handler
114 */ 113 */
@@ -123,7 +122,6 @@ struct GNUNET_SCHEDULER_Handle {
123 * context of hte SIGPIPE handler 122 * context of hte SIGPIPE handler
124 */ 123 */
125 struct GNUNET_SIGNAL_Context *shc_pipe; 124 struct GNUNET_SIGNAL_Context *shc_pipe;
126#endif
127}; 125};
128 126
129 127
@@ -621,13 +619,11 @@ static pid_t my_pid;
621/** 619/**
622 * Signal handler called for SIGPIPE. 620 * Signal handler called for SIGPIPE.
623 */ 621 */
624#ifndef MINGW
625static void 622static void
626sighandler_pipe() 623sighandler_pipe()
627{ 624{
628 return; 625 return;
629} 626}
630#endif
631 627
632 628
633///** 629///**
@@ -1396,7 +1392,6 @@ check_fd(struct GNUNET_SCHEDULER_Task *t, int raw_fd)
1396 * @return unique task identifier for the job 1392 * @return unique task identifier for the job
1397 * only valid until @a task is started! 1393 * only valid until @a task is started!
1398 */ 1394 */
1399#ifndef MINGW
1400static struct GNUNET_SCHEDULER_Task * 1395static struct GNUNET_SCHEDULER_Task *
1401add_without_sets(struct GNUNET_TIME_Relative delay, 1396add_without_sets(struct GNUNET_TIME_Relative delay,
1402 enum GNUNET_SCHEDULER_Priority priority, 1397 enum GNUNET_SCHEDULER_Priority priority,
@@ -1446,7 +1441,6 @@ add_without_sets(struct GNUNET_TIME_Relative delay,
1446 init_backtrace(t); 1441 init_backtrace(t);
1447 return t; 1442 return t;
1448} 1443}
1449#endif
1450 1444
1451 1445
1452/** 1446/**
@@ -1586,22 +1580,6 @@ GNUNET_SCHEDULER_add_net_with_priority(struct GNUNET_TIME_Relative delay,
1586{ 1580{
1587 /* scheduler must be running */ 1581 /* scheduler must be running */
1588 GNUNET_assert(NULL != scheduler_driver); 1582 GNUNET_assert(NULL != scheduler_driver);
1589
1590#if MINGW
1591 struct GNUNET_NETWORK_FDSet *s;
1592 struct GNUNET_SCHEDULER_Task * ret;
1593
1594 GNUNET_assert(NULL != fd);
1595 s = GNUNET_NETWORK_fdset_create();
1596 GNUNET_NETWORK_fdset_set(s, fd);
1597 ret = GNUNET_SCHEDULER_add_select(
1598 priority, delay,
1599 on_read ? s : NULL,
1600 on_write ? s : NULL,
1601 task, task_cls);
1602 GNUNET_NETWORK_fdset_destroy(s);
1603 return ret;
1604#else
1605 GNUNET_assert(on_read || on_write); 1583 GNUNET_assert(on_read || on_write);
1606 GNUNET_assert(GNUNET_NETWORK_get_fd(fd) >= 0); 1584 GNUNET_assert(GNUNET_NETWORK_get_fd(fd) >= 0);
1607 return add_without_sets(delay, priority, 1585 return add_without_sets(delay, priority,
@@ -1610,7 +1588,6 @@ GNUNET_SCHEDULER_add_net_with_priority(struct GNUNET_TIME_Relative delay,
1610 NULL, 1588 NULL,
1611 NULL, 1589 NULL,
1612 task, task_cls); 1590 task, task_cls);
1613#endif
1614} 1591}
1615 1592
1616 1593
@@ -1710,22 +1687,6 @@ GNUNET_SCHEDULER_add_file_with_priority(struct GNUNET_TIME_Relative delay,
1710{ 1687{
1711 /* scheduler must be running */ 1688 /* scheduler must be running */
1712 GNUNET_assert(NULL != scheduler_driver); 1689 GNUNET_assert(NULL != scheduler_driver);
1713
1714#if MINGW
1715 struct GNUNET_NETWORK_FDSet *s;
1716 struct GNUNET_SCHEDULER_Task * ret;
1717
1718 GNUNET_assert(NULL != fd);
1719 s = GNUNET_NETWORK_fdset_create();
1720 GNUNET_NETWORK_fdset_handle_set(s, fd);
1721 ret = GNUNET_SCHEDULER_add_select(
1722 priority, delay,
1723 on_read ? s : NULL,
1724 on_write ? s : NULL,
1725 task, task_cls);
1726 GNUNET_NETWORK_fdset_destroy(s);
1727 return ret;
1728#else
1729 GNUNET_assert(on_read || on_write); 1690 GNUNET_assert(on_read || on_write);
1730 GNUNET_assert(fd->fd >= 0); 1691 GNUNET_assert(fd->fd >= 0);
1731 return add_without_sets(delay, priority, 1692 return add_without_sets(delay, priority,
@@ -1734,7 +1695,6 @@ GNUNET_SCHEDULER_add_file_with_priority(struct GNUNET_TIME_Relative delay,
1734 on_read ? fd : NULL, 1695 on_read ? fd : NULL,
1735 on_write ? fd : NULL, 1696 on_write ? fd : NULL,
1736 task, task_cls); 1697 task, task_cls);
1737#endif
1738} 1698}
1739 1699
1740 1700
@@ -2218,14 +2178,12 @@ GNUNET_SCHEDULER_driver_init(const struct GNUNET_SCHEDULER_Driver *driver)
2218 sh->shc_gterm = GNUNET_SIGNAL_handler_install(GNUNET_TERM_SIG, 2178 sh->shc_gterm = GNUNET_SIGNAL_handler_install(GNUNET_TERM_SIG,
2219 &sighandler_shutdown); 2179 &sighandler_shutdown);
2220#endif 2180#endif
2221#ifndef MINGW
2222 sh->shc_pipe = GNUNET_SIGNAL_handler_install(SIGPIPE, 2181 sh->shc_pipe = GNUNET_SIGNAL_handler_install(SIGPIPE,
2223 &sighandler_pipe); 2182 &sighandler_pipe);
2224 sh->shc_quit = GNUNET_SIGNAL_handler_install(SIGQUIT, 2183 sh->shc_quit = GNUNET_SIGNAL_handler_install(SIGQUIT,
2225 &sighandler_shutdown); 2184 &sighandler_shutdown);
2226 sh->shc_hup = GNUNET_SIGNAL_handler_install(SIGHUP, 2185 sh->shc_hup = GNUNET_SIGNAL_handler_install(SIGHUP,
2227 &sighandler_shutdown); 2186 &sighandler_shutdown);
2228#endif
2229 2187
2230 /* Setup initial tasks */ 2188 /* Setup initial tasks */
2231 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT; 2189 current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT;
@@ -2282,11 +2240,9 @@ GNUNET_SCHEDULER_driver_done(struct GNUNET_SCHEDULER_Handle *sh)
2282#if (SIGTERM != GNUNET_TERM_SIG) 2240#if (SIGTERM != GNUNET_TERM_SIG)
2283 GNUNET_SIGNAL_handler_uninstall(sh->shc_gterm); 2241 GNUNET_SIGNAL_handler_uninstall(sh->shc_gterm);
2284#endif 2242#endif
2285#ifndef MINGW
2286 GNUNET_SIGNAL_handler_uninstall(sh->shc_pipe); 2243 GNUNET_SIGNAL_handler_uninstall(sh->shc_pipe);
2287 GNUNET_SIGNAL_handler_uninstall(sh->shc_quit); 2244 GNUNET_SIGNAL_handler_uninstall(sh->shc_quit);
2288 GNUNET_SIGNAL_handler_uninstall(sh->shc_hup); 2245 GNUNET_SIGNAL_handler_uninstall(sh->shc_hup);
2289#endif
2290 GNUNET_DISK_pipe_close(shutdown_pipe_handle); 2246 GNUNET_DISK_pipe_close(shutdown_pipe_handle);
2291 shutdown_pipe_handle = NULL; 2247 shutdown_pipe_handle = NULL;
2292 scheduler_driver = NULL; 2248 scheduler_driver = NULL;
@@ -2352,7 +2308,6 @@ select_loop(struct GNUNET_SCHEDULER_Handle *sh,
2352 2308
2353 LOG_STRERROR(GNUNET_ERROR_TYPE_ERROR, 2309 LOG_STRERROR(GNUNET_ERROR_TYPE_ERROR,
2354 "select"); 2310 "select");
2355#ifndef MINGW
2356#if USE_LSOF 2311#if USE_LSOF
2357 char lsof[512]; 2312 char lsof[512];
2358 2313
@@ -2366,7 +2321,6 @@ select_loop(struct GNUNET_SCHEDULER_Handle *sh,
2366 LOG_STRERROR(GNUNET_ERROR_TYPE_WARNING, 2321 LOG_STRERROR(GNUNET_ERROR_TYPE_WARNING,
2367 "system"); 2322 "system");
2368#endif 2323#endif
2369#endif
2370#if DEBUG_FDS 2324#if DEBUG_FDS
2371 for (struct Scheduled *s = context->scheduled_head; 2325 for (struct Scheduled *s = context->scheduled_head;
2372 NULL != s; 2326 NULL != s;