diff options
-rw-r--r-- | src/basic/log.c | 6 | ||||
-rw-r--r-- | src/basic/log.h | 4 | ||||
-rw-r--r-- | src/shared/conf-parser.c | 8 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/basic/log.c b/src/basic/log.c index 04d85e7ea..3367f8424 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -863,8 +863,8 @@ int log_oom_internal(LogRealm realm, const char *file, int line, const char *fun int log_format_iovec( struct iovec *iovec, - unsigned iovec_len, - unsigned *n, + size_t iovec_len, + size_t *n, bool newline_separator, int error, const char *format, @@ -945,7 +945,7 @@ int log_struct_internal( if (journal_fd >= 0) { char header[LINE_MAX]; struct iovec iovec[17] = {}; - unsigned n = 0, i; + size_t n = 0, i; int r; struct msghdr mh = { .msg_iov = iovec, diff --git a/src/basic/log.h b/src/basic/log.h index c4d089b19..7b67fd45b 100644 --- a/src/basic/log.h +++ b/src/basic/log.h @@ -182,8 +182,8 @@ int log_oom_internal( int log_format_iovec( struct iovec *iovec, - unsigned iovec_len, - unsigned *n, + size_t iovec_len, + size_t *n, bool newline_separator, int error, const char *format, diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index b95cd0fd5..59fa4d81e 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -851,7 +851,6 @@ int config_parse_log_facility( void *data, void *userdata) { - int *o = data, x; assert(filename); @@ -883,7 +882,6 @@ int config_parse_log_level( void *data, void *userdata) { - int *o = data, x; assert(filename); @@ -897,7 +895,11 @@ int config_parse_log_level( return 0; } - *o = (*o & LOG_FACMASK) | x; + if (*o < 0) /* if it wasn't initialized so far, assume zero facility */ + *o = x; + else + *o = (*o & LOG_FACMASK) | x; + return 0; } |