From: Roy Marples Date: Wed, 10 Sep 2008 12:39:20 +0000 (+0000) Subject: Move function lower down as it's not that important. X-Git-Tag: v5.0.0~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d94cb7804fb74fb2a6611e0e4e02ade206d38b4;p=thirdparty%2Fdhcpcd.git Move function lower down as it's not that important. --- 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) {