diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-11-28 17:06:10 +0100 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2017-12-07 13:53:42 +0100 |
commit | 574b2324275d3292e98a8e329f791eb5c799f7f2 (patch) | |
tree | 37f5bcc1edf1bcdcd61380c76fe214afce523bcd /sysdep/unix | |
parent | 3b3b0910ffb1b212b1c9ea420db6c575a3ecb71a (diff) |
Timers: Fix TBF and some last remains
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/io.c | 2 | ||||
-rw-r--r-- | sysdep/unix/log.c | 7 | ||||
-rw-r--r-- | sysdep/unix/timer.h | 4 |
3 files changed, 6 insertions, 7 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 3e56a32d..a196bbe2 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -2132,7 +2132,7 @@ io_init(void) // XXX init_times(); // XXX update_times(); boot_time = current_time(); - srandom((int) now_real); + srandom((uint) (current_real_time() TO_S)); } static int short_loops = 0; diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index e564f8f2..f9dccc39 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -180,19 +180,18 @@ log_msg(const char *msg, ...) void log_rl(struct tbf *f, const char *msg, ...) { - int last_hit = f->mark; int class = 1; va_list args; /* Rate limiting is a bit tricky here as it also logs '...' during the first hit */ - if (tbf_limit(f) && last_hit) + if (tbf_limit(f) && (f->drop > 1)) return; if (*msg >= 1 && *msg <= 8) class = *msg++; va_start(args, msg); - vlog(class, (f->mark ? "..." : msg), args); + vlog(class, (f->drop ? "..." : msg), args); va_end(args); } @@ -332,7 +331,7 @@ void mrt_dump_message(struct proto *p, u16 type, u16 subtype, byte *buf, u32 len) { /* Prepare header */ - put_u32(buf+0, now_real); + put_u32(buf+0, current_real_time() TO_S); put_u16(buf+4, type); put_u16(buf+6, subtype); put_u32(buf+8, len - MRTDUMP_HDR_LENGTH); diff --git a/sysdep/unix/timer.h b/sysdep/unix/timer.h index 495d10c7..989574bf 100644 --- a/sysdep/unix/timer.h +++ b/sysdep/unix/timer.h @@ -16,7 +16,7 @@ typedef struct timer2 timer; - +#if 0 static inline timer *tm_new(pool *p) { return (void *) tm2_new(p); } @@ -44,8 +44,8 @@ static inline void tm_start_max(timer *t, bird_clock_t after) static inline timer * tm_new_set(pool *p, void (*hook)(timer *), void *data, uint rand, uint rec) { return tm2_new_init(p, hook, data, rec S_, rand S_); } +#endif -#define TIME_INFINITY ((s64) 0x7fffffffffffffff) #endif |