#undef LOCAL_DEBUG
-#include "ucw/lib.h"
-#include "ucw/heap.h"
-#include "ucw/mainloop.h"
-#include "ucw/threads.h"
-#include "ucw/gary.h"
+#include <ucw/lib.h>
+#include <ucw/heap.h>
+#include <ucw/mainloop.h>
+#include <ucw/threads.h>
+#include <ucw/gary.h>
+#include <ucw/process.h>
+#include <ucw/time.h>
#include <stdio.h>
#include <string.h>
static void
main_get_time_ctx(struct main_context *m)
{
- struct timeval tv;
- gettimeofday(&tv, NULL);
- m->now_seconds = tv.tv_sec;
- m->now = (timestamp_t)tv.tv_sec * 1000 + tv.tv_usec / 1000;
+ m->now = get_timestamp();
}
static struct main_context *
struct main_context *m = main_current();
DBG("MAIN: Adding hook %p", ho);
- if (!hook_is_active(ho))
- clist_add_tail(&m->hook_list, &ho->n);
+ if (hook_is_active(ho))
+ clist_unlink(&ho->n);
+ clist_add_tail(&m->hook_list, &ho->n);
}
void
signal_del_ctx(main_current(), ms);
}
-#ifdef CONFIG_DEBUG
+#ifdef CONFIG_UCW_DEBUG
void
file_debug(struct main_file *fi)