From e61ad5c283f2319f8ad60c0b3ff3f906f2a0085b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 29 Nov 2017 11:37:21 +0100 Subject: [PATCH] journald: correct field counts MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit N_IOVEC_OBJECT_FIELDS is bumped 14 → 18 (see dispatch_message_real() and count!) N_IOVEC_PAYLOAD_FIELDS is bumped 15 → 16 (see server_space_usage_message() and count!) Also, add comments, to make clear what is what. --- src/journal/journald-server.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h index 5de44d7..8169bc9 100644 --- a/src/journal/journald-server.h +++ b/src/journal/journald-server.h @@ -182,11 +182,20 @@ struct Server { #define SERVER_MACHINE_ID(s) ((s)->machine_id_field + strlen("_MACHINE_ID=")) +/* Extra fields for any log messages */ #define N_IOVEC_META_FIELDS 22 + +/* Extra fields for log messages that contain OBJECT_PID= (i.e. log about another process) */ +#define N_IOVEC_OBJECT_FIELDS 18 + +/* Maximum number of fields we'll add in for driver (i.e. internal) messages */ +#define N_IOVEC_PAYLOAD_FIELDS 16 + +/* kmsg: Maximum number of extra fields we'll import from the kernel's /dev/kmsg */ #define N_IOVEC_KERNEL_FIELDS 64 + +/* kmsg: Maximum number of extra fields we'll import from udev's devices */ #define N_IOVEC_UDEV_FIELDS 32 -#define N_IOVEC_OBJECT_FIELDS 14 -#define N_IOVEC_PAYLOAD_FIELDS 15 void server_dispatch_message(Server *s, struct iovec *iovec, size_t n, size_t m, ClientContext *c, const struct timeval *tv, int priority, pid_t object_pid); void server_driver_message(Server *s, pid_t object_pid, const char *message_id, const char *format, ...) _sentinel_ _printf_(4,0); -- 2.7.4