From 27c8ca439fcf313cb6839e77ae988b231b188c58 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 3 Dec 2022 11:57:17 +0100 Subject: [PATCH] manager: write net/unix/max_dgram_qlen sysctl as fixed string --- src/basic/constants.h | 2 +- src/core/main.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/basic/constants.h b/src/basic/constants.h index 54021911ab3..4a24ba9c8cb 100644 --- a/src/basic/constants.h +++ b/src/basic/constants.h @@ -43,7 +43,7 @@ #define DEFAULT_EXIT_USEC (30*USEC_PER_SEC) /* The default value for the net.unix.max_dgram_qlen sysctl */ -#define DEFAULT_UNIX_MAX_DGRAM_QLEN 512UL +#define DEFAULT_UNIX_MAX_DGRAM_QLEN 512 #define SIGNALS_CRASH_HANDLER SIGSEGV,SIGILL,SIGFPE,SIGBUS,SIGQUIT,SIGABRT #define SIGNALS_IGNORE SIGPIPE diff --git a/src/core/main.c b/src/core/main.c index df83a1d2d42..9c1de3624cb 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1405,8 +1405,7 @@ static int bump_unix_max_dgram_qlen(void) { if (v >= DEFAULT_UNIX_MAX_DGRAM_QLEN) return 0; - r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", WRITE_STRING_FILE_DISABLE_BUFFER, - "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN); + r = sysctl_write("net/unix/max_dgram_qlen", STRINGIFY(DEFAULT_UNIX_MAX_DGRAM_QLEN)); if (r < 0) return log_full_errno(IN_SET(r, -EROFS, -EPERM, -EACCES) ? LOG_DEBUG : LOG_WARNING, r, "Failed to bump AF_UNIX datagram queue length, ignoring: %m"); -- 2.47.3