1 From 3a0181ab0fb6c40f613894e65009e148c6e652c9 Mon Sep 17 00:00:00 2001
2 From: Alyssa Ross <hi@alyssa.is>
3 Date: Mon, 16 Sep 2024 10:24:08 +0200
4 Subject: [PATCH] Remove outdated musl hack in rlimit_nofile_safe
6 This was incorrect, because RLIM_FMT is not the format specifier for uintmax_t.
8 Since 53e84063a ("Change RLIM_FMT to '%llu' for non-glibc builds (#269)"),
9 RLIM_FMT is correct for musl, so there's no longer any need for this casting
12 Link: https://github.com/elogind/elogind/pull/288
14 src/basic/rlimit-util.c | 4 ----
15 1 file changed, 4 deletions(-)
17 diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
18 index 091c111df..59bdc35a0 100644
19 --- a/src/basic/rlimit-util.c
20 +++ b/src/basic/rlimit-util.c
21 @@ -428,11 +428,7 @@ int rlimit_nofile_safe(void) {
22 rl.rlim_max = MIN(rl.rlim_max, (rlim_t) read_nr_open());
23 rl.rlim_cur = MIN((rlim_t) FD_SETSIZE, rl.rlim_max);
24 if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
25 -#ifdef __GLIBC__ /// To be compatible with musl-libc, elogind uses an (uintmax_t) cast.
26 return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", rl.rlim_cur);
28 - return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", (uintmax_t)rl.rlim_cur);