From: Lennart Poettering Date: Thu, 12 Sep 2024 15:46:12 +0000 (+0200) Subject: networkd: move sysctl code to use PID_FMT X-Git-Tag: v257-rc1~453^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a44fa55e267aa7b075d096b0333714af7c11a485;p=thirdparty%2Fsystemd.git networkd: move sysctl code to use PID_FMT Now that format-util.h doesn't pull in net/if.h anymore, we can use it to format PIDs in the networkd-sysctl.c code. --- diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c index d61c208f840..4c83a6c9a9c 100644 --- a/src/network/networkd-sysctl.c +++ b/src/network/networkd-sysctl.c @@ -9,6 +9,7 @@ #include "af-list.h" #include "cgroup-util.h" #include "fd-util.h" +#include "format-util.h" #include "missing_network.h" #include "networkd-link.h" #include "networkd-lldp-tx.h" @@ -72,14 +73,14 @@ static int sysctl_event_handler(void *ctx, void *data, size_t data_sz) { if (!strneq(value, we->newvalue, sizeof(we->newvalue))) log_struct(LOG_WARNING, "MESSAGE_ID=" SD_MESSAGE_SYSCTL_CHANGED_STR, - "OBJECT_PID=%d", we->pid, + "OBJECT_PID=" PID_FMT, we->pid, "OBJECT_COMM=%s", we->comm, - "SYSCTL=/proc/sys/%s", we->path, + "SYSCTL=%s", path, "OLDVALUE=%s", we->current, "NEWVALUE=%s", we->newvalue, "OURVALUE=%s", value, - LOG_MESSAGE("Foreign process '%s[%d]' changed sysctl '/proc/sys/%s' from '%s' to '%s', conflicting with our setting to '%s'", - we->comm, we->pid, we->path, we->current, we->newvalue, value)); + LOG_MESSAGE("Foreign process '%s[" PID_FMT "]' changed sysctl '%s' from '%s' to '%s', conflicting with our setting to '%s'.", + we->comm, we->pid, path, we->current, we->newvalue, value)); return 0; }