summaryrefslogtreecommitdiff
path: root/sysdep/unix/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdep/unix/log.c')
-rw-r--r--sysdep/unix/log.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c
index 88a7188c..f9dccc39 100644
--- a/sysdep/unix/log.c
+++ b/sysdep/unix/log.c
@@ -27,7 +27,7 @@
#include "nest/mrtdump.h"
#include "lib/string.h"
#include "lib/lists.h"
-#include "lib/unix.h"
+#include "sysdep/unix/unix.h"
static FILE *dbgf;
static list *current_log_list;
@@ -120,7 +120,7 @@ log_commit(int class, buffer *buf)
else
{
byte tbuf[TM_DATETIME_BUFFER_SIZE];
- tm_format_datetime(tbuf, &config->tf_log, now);
+ tm_format_real_time(tbuf, config->tf_log.fmt1, current_real_time());
fprintf(l->fh, "%s <%s> ", tbuf, class_names[class]);
}
fputs(buf->start, l->fh);
@@ -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);