summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/event.c2
-rw-r--r--lib/event.h7
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/event.c b/lib/event.c
index 916cf55c..b429c205 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -27,7 +27,7 @@ event_list global_event_list;
inline void
ev_postpone(event *e)
{
- if (e->n.next)
+ if (ev_active(e))
{
rem_node(&e->n);
e->n.next = NULL;
diff --git a/lib/event.h b/lib/event.h
index d8500413..d5975222 100644
--- a/lib/event.h
+++ b/lib/event.h
@@ -30,4 +30,11 @@ void ev_schedule(event *);
void ev_postpone(event *);
int ev_run_list(event_list *);
+static inline int
+ev_active(event *e)
+{
+ return e->n.next != NULL;
+}
+
+
#endif