struct GNUNET_SIGNAL_Context *shc_gterm;
#endif
-#ifndef MINGW
/**
* context of the SIGQUIT handler
*/
* context of hte SIGPIPE handler
*/
struct GNUNET_SIGNAL_Context *shc_pipe;
-#endif
};
/**
* Signal handler called for SIGPIPE.
*/
-#ifndef MINGW
static void
sighandler_pipe()
{
return;
}
-#endif
///**
* @return unique task identifier for the job
* only valid until @a task is started!
*/
-#ifndef MINGW
static struct GNUNET_SCHEDULER_Task *
add_without_sets(struct GNUNET_TIME_Relative delay,
enum GNUNET_SCHEDULER_Priority priority,
init_backtrace(t);
return t;
}
-#endif
/**
{
/* scheduler must be running */
GNUNET_assert(NULL != scheduler_driver);
-
-#if MINGW
- struct GNUNET_NETWORK_FDSet *s;
- struct GNUNET_SCHEDULER_Task * ret;
-
- GNUNET_assert(NULL != fd);
- s = GNUNET_NETWORK_fdset_create();
- GNUNET_NETWORK_fdset_set(s, fd);
- ret = GNUNET_SCHEDULER_add_select(
- priority, delay,
- on_read ? s : NULL,
- on_write ? s : NULL,
- task, task_cls);
- GNUNET_NETWORK_fdset_destroy(s);
- return ret;
-#else
GNUNET_assert(on_read || on_write);
GNUNET_assert(GNUNET_NETWORK_get_fd(fd) >= 0);
return add_without_sets(delay, priority,
NULL,
NULL,
task, task_cls);
-#endif
}
{
/* scheduler must be running */
GNUNET_assert(NULL != scheduler_driver);
-
-#if MINGW
- struct GNUNET_NETWORK_FDSet *s;
- struct GNUNET_SCHEDULER_Task * ret;
-
- GNUNET_assert(NULL != fd);
- s = GNUNET_NETWORK_fdset_create();
- GNUNET_NETWORK_fdset_handle_set(s, fd);
- ret = GNUNET_SCHEDULER_add_select(
- priority, delay,
- on_read ? s : NULL,
- on_write ? s : NULL,
- task, task_cls);
- GNUNET_NETWORK_fdset_destroy(s);
- return ret;
-#else
GNUNET_assert(on_read || on_write);
GNUNET_assert(fd->fd >= 0);
return add_without_sets(delay, priority,
on_read ? fd : NULL,
on_write ? fd : NULL,
task, task_cls);
-#endif
}
sh->shc_gterm = GNUNET_SIGNAL_handler_install(GNUNET_TERM_SIG,
&sighandler_shutdown);
#endif
-#ifndef MINGW
sh->shc_pipe = GNUNET_SIGNAL_handler_install(SIGPIPE,
&sighandler_pipe);
sh->shc_quit = GNUNET_SIGNAL_handler_install(SIGQUIT,
&sighandler_shutdown);
sh->shc_hup = GNUNET_SIGNAL_handler_install(SIGHUP,
&sighandler_shutdown);
-#endif
/* Setup initial tasks */
current_priority = GNUNET_SCHEDULER_PRIORITY_DEFAULT;
#if (SIGTERM != GNUNET_TERM_SIG)
GNUNET_SIGNAL_handler_uninstall(sh->shc_gterm);
#endif
-#ifndef MINGW
GNUNET_SIGNAL_handler_uninstall(sh->shc_pipe);
GNUNET_SIGNAL_handler_uninstall(sh->shc_quit);
GNUNET_SIGNAL_handler_uninstall(sh->shc_hup);
-#endif
GNUNET_DISK_pipe_close(shutdown_pipe_handle);
shutdown_pipe_handle = NULL;
scheduler_driver = NULL;
LOG_STRERROR(GNUNET_ERROR_TYPE_ERROR,
"select");
-#ifndef MINGW
#if USE_LSOF
char lsof[512];
LOG_STRERROR(GNUNET_ERROR_TYPE_WARNING,
"system");
#endif
-#endif
#if DEBUG_FDS
for (struct Scheduled *s = context->scheduled_head;
NULL != s;