aboutsummaryrefslogtreecommitdiff
path: root/src/arm/gnunet-service-arm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arm/gnunet-service-arm.c')
-rw-r--r--src/arm/gnunet-service-arm.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c
index ea89b2989..28d448f75 100644
--- a/src/arm/gnunet-service-arm.c
+++ b/src/arm/gnunet-service-arm.c
@@ -630,16 +630,17 @@ find_service (const char *name)
630 * create the service in order to relay the incoming connection to it 630 * create the service in order to relay the incoming connection to it
631 * 631 *
632 * @param cls callback data, `struct ServiceListeningInfo` describing a listen socket 632 * @param cls callback data, `struct ServiceListeningInfo` describing a listen socket
633 * @param tc context
634 */ 633 */
635static void 634static void
636accept_connection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 635accept_connection (void *cls)
637{ 636{
638 struct ServiceListeningInfo *sli = cls; 637 struct ServiceListeningInfo *sli = cls;
639 struct ServiceList *sl = sli->sl; 638 struct ServiceList *sl = sli->sl;
639 const struct GNUNET_SCHEDULER_TaskContext *tc;
640 640
641 sli->accept_task = NULL; 641 sli->accept_task = NULL;
642 GNUNET_assert (GNUNET_NO == in_shutdown); 642 GNUNET_assert (GNUNET_NO == in_shutdown);
643 tc = GNUNET_SCHEDULER_get_task_context ();
643 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason)) 644 if (0 != (GNUNET_SCHEDULER_REASON_SHUTDOWN & tc->reason))
644 return; 645 return;
645 start_process (sl, NULL, 0); 646 start_process (sl, NULL, 0);
@@ -845,11 +846,9 @@ handle_start (void *cls,
845 * Start a shutdown sequence. 846 * Start a shutdown sequence.
846 * 847 *
847 * @param cls closure (refers to service) 848 * @param cls closure (refers to service)
848 * @param tc task context
849 */ 849 */
850static void 850static void
851trigger_shutdown (void *cls, 851trigger_shutdown (void *cls)
852 const struct GNUNET_SCHEDULER_TaskContext *tc)
853{ 852{
854 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 853 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
855 "Triggering shutdown\n"); 854 "Triggering shutdown\n");
@@ -1060,11 +1059,9 @@ list_count (struct ServiceList *running_head)
1060 * Task run for shutdown. 1059 * Task run for shutdown.
1061 * 1060 *
1062 * @param cls closure, NULL if we need to self-restart 1061 * @param cls closure, NULL if we need to self-restart
1063 * @param tc context
1064 */ 1062 */
1065static void 1063static void
1066shutdown_task (void *cls, 1064shutdown_task (void *cls)
1067 const struct GNUNET_SCHEDULER_TaskContext *tc)
1068{ 1065{
1069 struct ServiceList *pos; 1066 struct ServiceList *pos;
1070 struct ServiceList *nxt; 1067 struct ServiceList *nxt;
@@ -1129,17 +1126,18 @@ shutdown_task (void *cls,
1129 * Task run whenever it is time to restart a child that died. 1126 * Task run whenever it is time to restart a child that died.
1130 * 1127 *
1131 * @param cls closure, always NULL 1128 * @param cls closure, always NULL
1132 * @param tc context
1133 */ 1129 */
1134static void 1130static void
1135delayed_restart_task (void *cls, 1131delayed_restart_task (void *cls)
1136 const struct GNUNET_SCHEDULER_TaskContext *tc) 1132
1137{ 1133{
1134 const struct GNUNET_SCHEDULER_TaskContext *tc;
1138 struct ServiceList *sl; 1135 struct ServiceList *sl;
1139 struct GNUNET_TIME_Relative lowestRestartDelay; 1136 struct GNUNET_TIME_Relative lowestRestartDelay;
1140 struct ServiceListeningInfo *sli; 1137 struct ServiceListeningInfo *sli;
1141 1138
1142 child_restart_task = NULL; 1139 child_restart_task = NULL;
1140 tc = GNUNET_SCHEDULER_get_task_context ();
1143 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) 1141 if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
1144 return; 1142 return;
1145 GNUNET_assert (GNUNET_NO == in_shutdown); 1143 GNUNET_assert (GNUNET_NO == in_shutdown);
@@ -1204,12 +1202,11 @@ delayed_restart_task (void *cls,
1204 * process died). 1202 * process died).
1205 * 1203 *
1206 * @param cls closure, NULL if we need to self-restart 1204 * @param cls closure, NULL if we need to self-restart
1207 * @param tc context
1208 */ 1205 */
1209static void 1206static void
1210maint_child_death (void *cls, 1207maint_child_death (void *cls)
1211 const struct GNUNET_SCHEDULER_TaskContext *tc)
1212{ 1208{
1209 const struct GNUNET_SCHEDULER_TaskContext *tc;
1213 struct ServiceList *pos; 1210 struct ServiceList *pos;
1214 struct ServiceList *next; 1211 struct ServiceList *next;
1215 struct ServiceListeningInfo *sli; 1212 struct ServiceListeningInfo *sli;
@@ -1223,6 +1220,7 @@ maint_child_death (void *cls,
1223 1220
1224 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ); 1221 pr = GNUNET_DISK_pipe_handle (sigpipe, GNUNET_DISK_PIPE_END_READ);
1225 child_death_task = NULL; 1222 child_death_task = NULL;
1223 tc = GNUNET_SCHEDULER_get_task_context ();
1226 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY)) 1224 if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
1227 { 1225 {
1228 /* shutdown scheduled us, ignore! */ 1226 /* shutdown scheduled us, ignore! */