call ev_schedule() on the same handler which should work perfectly now.
return !nobs;
}
-static int
+static void
config_done(void *unused)
{
struct config *c;
if (!config_do_commit(c))
break;
}
- return 0;
}
int
return e;
}
-inline int
+inline void
ev_run(event *e)
{
- int keep = e->hook(e->data);
- if (!keep)
- ev_postpone(e);
- return keep;
+ ev_postpone(e);
+ e->hook(e->data);
}
inline void
ev_enqueue(event_list *l, event *e)
{
- if (e->n.next)
- rem_node(&e->n);
+ ev_postpone(e);
add_tail(l, &e->n);
}
ev_run_list(event_list *l)
{
node *n, *p;
+ list tmp_list;
- WALK_LIST_DELSAFE(n, p, *l)
+ init_list(&tmp_list);
+ add_tail_list(&tmp_list, l);
+ init_list(l);
+ WALK_LIST_DELSAFE(n, p, tmp_list)
{
event *e = SKIP_BACK(event, n, n);
ev_run(e);
typedef struct event {
resource r;
- int (*hook)(void *);
+ void (*hook)(void *);
void *data;
node n; /* Internal link */
} event;
extern event_list global_event_list;
event *ev_new(pool *);
-int ev_run(event *);
+void ev_run(event *);
#define ev_init_list(el) init_list(el)
void ev_enqueue(event_list *, event *);
void ev_schedule(event *);
ev_schedule(olock_event);
}
-int
+static void
olock_run_event(void *unused)
{
node *n;
add_tail(&olock_list, &q->n);
q->hook(q);
}
- return 0;
}
void
static char *p_states[] = { "DOWN", "START", "UP", "STOP" };
static char *c_states[] = { "HUNGRY", "FEEDING", "HAPPY", "FLUSHING" };
-static int proto_flush_all(void *);
+static void proto_flush_all(void *);
static void proto_rethink_goal(struct proto *p);
static char *proto_state_name(struct proto *p);
proto_rethink_goal(p);
}
-static int
+static void
proto_feed(void *P)
{
struct proto *p = P;
p->core_state = FS_HAPPY;
proto_relink(p);
DBG("Protocol %s up and running\n", p->name);
- return 0;
}
void
proto_relink(p);
}
-static int
+static void
proto_flush_all(void *unused)
{
struct proto *p;
proto_relink(p);
proto_fell_down(p);
}
- return 0;
}
/*
rt_dump(t);
}
-static int
+static void
rt_gc(void *tab)
{
rtable *t = tab;
DBG("Entered routing table garbage collector for %s after %d seconds and %d deletes\n",
t->name, (int)(now - t->gc_time), t->gc_counter);
rt_prune(t);
- return 0;
}
void