summaryrefslogtreecommitdiffstats
path: root/eloop.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-09-10 12:39:20 +0000
committerRoy Marples <roy@marples.name>2008-09-10 12:39:20 +0000
commit9d94cb7804fb74fb2a6611e0e4e02ade206d38b4 (patch)
tree64ce2ba391a9b98d94376c063afc7028ee1fa228 /eloop.c
parentb6b003adbae25eba9d7318ce0a249da480e61683 (diff)
downloaddhcpcd-9d94cb7804fb74fb2a6611e0e4e02ade206d38b4.tar.xz
Move function lower down as it's not that important.
Diffstat (limited to 'eloop.c')
-rw-r--r--eloop.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/eloop.c b/eloop.c
index 227ed4c7..8f601349 100644
--- a/eloop.c
+++ b/eloop.c
@@ -58,40 +58,6 @@ static struct timeout *free_timeouts = NULL;
static struct pollfd *fds = NULL;
static size_t fds_len = 0;
-#ifdef DEBUG_MEMORY
-/* Define this to free all malloced memory.
- * Normally we don't do this as the OS will do it for us at exit,
- * but it's handy for debugging other leaks in valgrind. */
-static void
-cleanup(void)
-{
- struct event *e;
- struct timeout *t;
-
- while (events) {
- e = events->next;
- free(events);
- events = e;
- }
- while (free_events) {
- e = free_events->next;
- free(free_events);
- free_events = e;
- }
- while (timeouts) {
- t = timeouts->next;
- free(timeouts);
- timeouts = t;
- }
- while (free_timeouts) {
- t = free_timeouts->next;
- free(free_timeouts);
- free_timeouts = t;
- }
- free(fds);
-}
-#endif
-
void
add_event(int fd, void (*callback)(void *), void *arg)
{
@@ -261,6 +227,40 @@ delete_timeout(void (*callback)(void *), void *arg)
}
}
+#ifdef DEBUG_MEMORY
+/* Define this to free all malloced memory.
+ * Normally we don't do this as the OS will do it for us at exit,
+ * but it's handy for debugging other leaks in valgrind. */
+static void
+cleanup(void)
+{
+ struct event *e;
+ struct timeout *t;
+
+ while (events) {
+ e = events->next;
+ free(events);
+ events = e;
+ }
+ while (free_events) {
+ e = free_events->next;
+ free(free_events);
+ free_events = e;
+ }
+ while (timeouts) {
+ t = timeouts->next;
+ free(timeouts);
+ timeouts = t;
+ }
+ while (free_timeouts) {
+ t = free_timeouts->next;
+ free(free_timeouts);
+ free_timeouts = t;
+ }
+ free(fds);
+}
+#endif
+
_noreturn void
start_eloop(void)
{