]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move function lower down as it's not that important.
authorRoy Marples <roy@marples.name>
Wed, 10 Sep 2008 12:39:20 +0000 (12:39 +0000)
committerRoy Marples <roy@marples.name>
Wed, 10 Sep 2008 12:39:20 +0000 (12:39 +0000)
eloop.c

diff --git a/eloop.c b/eloop.c
index 227ed4c784a93c457419721a505113644b6f0b90..8f60134939b38a5fb0616c9994508111a7cdcf7d 100644 (file)
--- 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)
 {