mirror of
https://github.com/systemd/systemd.git
synced 2024-11-02 10:51:20 +03:00
log: be a bit less wasteful when allocating buffers
This commit is contained in:
parent
086891e5c1
commit
e09ca588d2
@ -366,7 +366,7 @@ static int write_to_syslog(
|
||||
const char *object,
|
||||
const char *buffer) {
|
||||
|
||||
char header_priority[16], header_time[64], header_pid[16];
|
||||
char header_priority[1 + DECIMAL_STR_MAX(int) + 2], header_time[64], header_pid[1 + DECIMAL_STR_MAX(pid_t) + 4];
|
||||
struct iovec iovec[5] = {};
|
||||
struct msghdr msghdr = {
|
||||
.msg_iov = iovec,
|
||||
@ -429,7 +429,7 @@ static int write_to_kmsg(
|
||||
const char *object,
|
||||
const char *buffer) {
|
||||
|
||||
char header_priority[16], header_pid[16];
|
||||
char header_priority[1 + DECIMAL_STR_MAX(int) + 2], header_pid[1 + DECIMAL_STR_MAX(pid_t) + 4];
|
||||
struct iovec iovec[5] = {};
|
||||
|
||||
if (kmsg_fd < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user