summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-09-12 17:46:12 +0200
committerLennart Poettering <lennart@poettering.net>2024-09-13 07:28:51 +0200
commita44fa55e267aa7b075d096b0333714af7c11a485 (patch)
tree8a0e965305fce198699e7b5b0eac9b1c6a41b1f6 /src
parentbasic: split ifname related calls from format-util.h into format-ifname.h (diff)
downloadsystemd-a44fa55e267aa7b075d096b0333714af7c11a485.tar.xz
systemd-a44fa55e267aa7b075d096b0333714af7c11a485.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-sysctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/network/networkd-sysctl.c b/src/network/networkd-sysctl.c
index d61c208f84..4c83a6c9a9 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;
}