time_t mtime;
/**
- * Process exponential backoff time
+ * Process exponential backoff time
*/
struct GNUNET_TIME_Relative backoff;
/**
- * Absolute time at which the process is scheduled to restart in case of death
+ * Absolute time at which the process is scheduled to restart in case of death
*/
struct GNUNET_TIME_Absolute restartAt;
/**
- * We are done with everything. Stop remaining
- * tasks, signal handler and the server.
+ * We are done with everything. Stop remaining
+ * tasks, signal handler and the server.
*/
static void
do_shutdown ()
shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct ServiceList *pos;
+ struct ServiceList *nxt;
#if DEBUG_ARM
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Stopping all services\n"));
pos = running_head;
while (NULL != pos)
{
+ nxt = pos->next;
if (pos->proc != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping service `%s'\n", pos->name);
if (0 != GNUNET_OS_process_kill (pos->proc, SIGTERM))
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
}
- pos = pos->next;
+ else
+ {
+ free_service (pos);
+ }
+ pos = nxt;
}
if (running_head == NULL)
do_shutdown ();
/**
* Task triggered whenever we receive a SIGCHLD (child
- * process died).
+ * process died).
*
* @param cls closure, NULL if we need to self-restart
* @param tc context