From: Zbigniew Jędrzejewski-Szmek Date: Sat, 3 Dec 2022 10:57:17 +0000 (+0100) Subject: manager: write net/unix/max_dgram_qlen sysctl as fixed string X-Git-Tag: v253-rc1~378^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F25618%2Fhead;p=thirdparty%2Fsystemd.git manager: write net/unix/max_dgram_qlen sysctl as fixed string --- 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");