1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Merge commit 'fc9d471b' into thread-next

Conflicts:
	conf/cf-lex.l
	conf/conf.h
	filter/config.Y
	filter/data.c
	filter/data.h
This commit is contained in:
Maria Matejka
2023-10-28 23:42:21 +02:00
17 changed files with 899 additions and 329 deletions

View File

@@ -197,12 +197,12 @@ log_commit(log_buffer *buf)
byte *begin = l->terminal ? buf->buf.start : buf->tm_pos;
off_t msg_len = buf->buf.pos - begin + 1;
do {
if (rf_write(rf, buf->tm_pos, msg_len))
if (rf_write(rf, begin, msg_len))
break;
log_lock();
rf = atomic_load_explicit(&l->rf, memory_order_acquire);
if (rf_write(rf, buf->tm_pos, msg_len))
if (rf_write(rf, begin, msg_len))
{
log_unlock();
break;
@@ -212,7 +212,7 @@ log_commit(log_buffer *buf)
log_unlock();
rf = atomic_load_explicit(&l->rf, memory_order_relaxed);
} while (!rf_write(rf, buf->tm_pos, msg_len));
} while (!rf_write(rf, begin, msg_len));
}
#ifdef HAVE_SYSLOG_H
else
@@ -251,6 +251,8 @@ log_prepare(log_buffer *buf, int class)
buffer_print(&buf->buf, " [%04x] <%s> ", THIS_THREAD_ID, class_names[class]);
}
else
buf->tm_pos = NULL;
buf->msg_pos = buf->buf.pos;
buf->class = class;